BlitzMax Toolkit Stupid Error --HELP!
Posted: Sat May 05, 2012 9:46 am
Hey you guys, I've decided to use BlitzMax for my game engine's toolkit and thus as a result I am experimenting with the Blitz language.
Through my endeavours my code has broken, with what seems to be a silly error, so now I consult the good people of ChaosRift for help with my primitive problems.
Here is the code:
Here is the errors:
Thanks in advance.
EDIT: Updated code to apply with Blitz conventions.
Through my endeavours my code has broken, with what seems to be a silly error, so now I consult the good people of ChaosRift for help with my primitive problems.
Here is the code:
Code: Select all
Main() 'invoke Main function
'DECLRATION CRAP --TYPE SHIT
Type TVec2d 'two-dimensional vector biatch
Field X:Int
Field Y:Int
End Type
Type TFrame
Field Pos:TVec2d = New TVec2d 'position
Field Siz:TVec2d = New TVec2d 'size --used for collision prob.
Field Rot:TVec2d = New TVec2d 'rotation
Field Sca:TVec2d = New TVec2d 'scale
End Type
Type TSprite
Field Image:TImage = New TImage
Field Body:TFrame = New TFrame
Field Clip:TFrame = New TFrame
Method ImageLoad(address:String)
Image = LoadImage(LoadBank(address))
End Method
Method ImageRender()
DrawImage(Image,Body.Pos.X,Body.Pos.Y)
End Method
End Type
'TYPE-INSTANCE DECLARATIONS
Player:TSprite = New TSprite
'FUNCTION CRAP --CHECK FOR ALL THE CRAZY BULLSHIT
Function Main:Int()
Init()
While (True)
Render()
Flip() 'flip screen buffer
Cls() 'clear screen
Keyboard()
Mouse()
End While
Return 0;
End Function
Function Init:Int() 'this function is run ONLY ONCE at the start of the program
AppTitle = "Arcadian Descent Toolkit"
Graphics(640,480,0) 'initialize screen size
ShowMouse()
Player.Body:TFrame.Pos:TVec2d.X = 100;
Player.Body:TFrame.Pos:TVec2d.Y = 100;
Player.ImageLoad("megaman.jpg")
Return 0;
End Function
Function Render:Int() 'render graphics
SetColor(255,255,255)
DrawText("Mouse("+MouseX()+", "+MouseY()+")",0,0)
SetColor(255,0,255)
DrawRect(32,32,32,32)
player.imageRender()
Return 0;
End Function
Function Keyboard:Int() 'check for key presses
If KeyHit(KEY_ESCAPE) Or AppTerminate() Then
End
End If
Return 0;
End Function
Function Mouse:Int() 'check where the mouse is
Return 0;
End Function
...I just find that to be an amusing error.Identifier 'body' not found
Thanks in advance.
EDIT: Updated code to apply with Blitz conventions.