16
Axe / Need help with horribly coded platform engine
« on: March 13, 2012, 10:45:21 pm »
I need to get this to stop closing when it starts. Not sure what change I made that did it, but it worked perfectly before. Also if possible I want to ask for a simple way to draw a static tilemap (no scrolling) that I can fit in here; I'd rather be able to understand it than have it be barely faster. Tried fixing this for days with no luck but thanks to the Mac version of TI-Connect being fantastic and including an actual BASIC editor and a logical transfer method I can get this up here for examination and help. If you have a Mac I recommend
that port, I just dusted off my old PPC.
that port, I just dusted off my old PPC.
Code: [Select]
.TEST
.GFX
ClrDraw
ClrDraw
[FFFFC3DBDBC3FFFF]→Pic0
[FF9999FFFF9999FF]→Pic2
[00FF00FF00FFFF00]
.MOV1
[10107CBCBA282834]→Pic1
.MOV2
[10107CBCBA284466]
.MOV3
[08083E3D5D14142C]→Pic9
.MOV4
[08083E3D5D142266]
.VARS
0→J→Q→D→F→L
20→X→Y
.MAINLOOP
While Q=0
.GREY
ClrDraw
Pt-On(16,48,Pic2)
Pt-On(32,48,Pic2)
Pt-On(32,40,Pic2)
DispGraph
ClrDraw
.LVDRAW
Pt-On(16,40,Pic0
Pt-On(32,32,Pic0
Pt-On(0,56,Pic0
Pt-On(8,56,Pic0
Pt-On(16,56,Pic0
Pt-On(24,56,Pic0
Pt-On(32,56,Pic0
Pt-On(40,56,Pic0
Pt-On(48,56,Pic0
Pt-On(56,56,Pic0
Pt-On(64,56,Pic0
Pt-On(72,56,Pic0
Pt-On(80,56,Pic0
Pt-On(88,56,Pic0
.ANIM
If F>16
0→F
End
If F>8
If D=1
Pt-On(X,Y,Pic1+8
Else
Pt-On(X,Y,Pic9+8
End
Else
If D=1
Pt-On(X,Y,Pic1
Else
Pt-On(X,Y,Pic9
End
End
.KEY-QUIT
If getKey(15)
1→Q
End
.KEY-LEFT
If (getKey(2)) and (pxl-Test(X-1,Y)=0) and (pxl-Test(X-1,Y+7)=0)
X-1→X
0→D
F+1→F
End
.KEY-RIGHT
If (getKey(3)) and (pxl-Test(X+8,Y)=0) and (pxl-Test(X+8,Y+7)=0)
X+1→X
1→D
F+1→F
End
.GRAVITY
If (J=0) and (pxl-Test(X,Y+8)=0) and (pxl-Test(X+7,Y+8)=0)
Y+1→Y
End
If J>0
If (pxl-Test(X,Y-1)=0) and (pxl-Test(X+7,Y-1)=0)
Y-1→Y
End
J-1→J
End
.KEY-JUMP
If getKey(54)
If (pxl-Test(X,Y+9)=1) or (pxl-Test(X+7,Y+9)=1)
16→J
End
End
DispGraph
End
Pause 1000