When I run the program and I got the sound working.
when I got the demo up and running....it doesnt show the graphics on the screen but music is on
it say Unhandled exception: Attempt to access field or method of null object
I also add the code and exe files in the attachments
' Shadow of the Beast Demo :)
SuperStrict
Rem
v0.53 fixed the filelist so that only the actual song being played is highlighted regardless of changing folders
v0.52 fixed the filelist so that it only shows folders and actual modfiles
v0.51 first release
EndRem
Framework BRL.GLMax2D
Import aln.bass
SetGraphicsDriver GLMax2DDriver()
AppTitle="Alan BASS module test"
' GLOBALS
Global musicmodule:TBassmod = New TBassmod
musicmodule.Load("media\b-title.mod", 0 )
musicmodule.Play()
Graphics 640,480,0
Global T_list:TList = New TList
Global Background1:TImage=LoadImage("media\bgd1_ciel.png")
Global Background2:TImage=LoadImage("media\bgd2_montagnes.PNG")
Global Background3:TImage=LoadImage("media\bgd3_sol1.png")
Global Background4:TImage=LoadImage("media\bgd4_sol2.png")
Global Background5:TImage=LoadImage("media\bgd5_sol3.png")
Global Background6:TImage=LoadImage("media\sprite_barriere.bmp")
' Put the Clouds in the sky
Global Cloud1:TImage=LoadImage("media\sprite_nuages1.bmp")
Global Cloud2:TImage=LoadImage("media\sprite_nuages2.bmp")
Global Cloud3:TImage=LoadImage("media\sprite_nuages3.bmp")
Global Cloud4:TImage=LoadImage("media\sprite_nuages4.bmp")
Global Tree :TImage=LoadImage("media\sprite_arbre.png")
Type TBackground
Field x: Int , y:Int
Field x1:Int, y1:Int
Field x2:Int, y2:Int
Field x3:Int, y3:Int
Field x4:Int, y4:Int
Field x5:Int, y5:Int
Field x6:Int, y6:Int
Field c:Int,c2:Int,c3:Int,c4:Int
Field t:Int
Method Draw()
SetViewport 0,0,GraphicsWidth(),background1.height ' WHY IT IS ERROR?
TileImage Background1,x,0
DrawImage Cloud1,c+GraphicsWidth(),0
DrawImage Cloud2,c2+GraphicsWidth(),10
DrawImage Cloud3,c3+GraphicsWidth(),20
DrawImage Cloud4,c4+GraphicsWidth(),30
' fixed the tree ! YAY
SetViewport 0,150,GraphicsWidth(),background2.height
TileImage Background2,x2,150
SetViewport 0,0,GraphicsWidth(),GraphicsHeight()
DrawImage Tree,200+t,95
SetViewport 0,370,GraphicsWidth(),background3.height
TileImage Background3,x3,370
SetViewport 0,380,GraphicsWidth(),background4.height
TileImage Background4,x4,380
SetViewport 0,400,GraphicsWidth(),background5.height
TileImage Background5,x5,400
SetViewport 0,390,GraphicsWidth(),background6.height
TileImage Background6,x6,390
x =(x-1 ) Mod background1.width
x2=(x2-1.5) Mod background2.width
x3=(x3-2) Mod background3.width
x4=(x4-3) Mod background4.width
x5=(x5-5) Mod background5.width
x6=(x6-6) Mod background6.width
c=(c-3)
c2=(c2-2)
c3=(c3-1)
c4=(c4-1)
t=(t-3)
' Does the background come off the screen? if yes then
' Repeat!
If c=<-1500
c=800
EndIf
If c2=<-1500
c2=800
EndIf
If c3=<-1500
c3=800
EndIf
If c4=<-1500
c4=800
EndIf
If t=<-2000
t=800
EndIf
SetViewport 0,0,GraphicsWidth(),GraphicsHeight()
EndMethod
End Type
Local T:Tbackground=New Tbackground
Repeat
Cls
If AppTerminate() Then
musicmodule.Free()
EndGraphics
End
End If
T.Draw
Flip
Until MouseHit(1)
musicmodule.Free()
EndGraphics()
End