OK, I honestly dont know where its coming from. If you move around long enough, it just gets slower and slower. Takes about 15 seconds before you start to see it getting pretty slow. To the point that it takes about a half second between hitting an arrow key, to actually moving the sprite. To start with, its far less than 1/8th of a second.
Yes, this uses xLIB for drawing the sprites. Thats where the real(... entries come from.
ZMOVE (Main app, for now)
Code:
ZOBJECTS (Collision detection subroutine)
Code:
Now, I have NO doubt this could be HIGHLY optimized, but for now, Im trying to find the memory leak(s) and speed up what I have so far.
This is part of Null RPG (my upcoming game). So any help would be GREATLY appreciated!
Here is a link to my post for it:
Null RPG
Yes, this uses xLIB for drawing the sprites. Thats where the real(... entries come from.
ZMOVE (Main app, for now)
Code:
8→V
Ans→W
Ans→X
Ans→Y
real(1,X,Y,1,8,0,1,0,0,0,1
Lbl ZZ
Repeat Ans
getKey
End
Ans→K
If K=33:Then
prgmZSTATS
Goto ZZ
End
If K=25:Then
(Y-8)/8→U
X/8→T
prgmZOBJECTS
If S=1:Then
X→V
Y→W
Y-8→Y
Goto DR
Else
Goto ZZ
End
End
If K=34:Then
(Y+8)/8→U
X/8→T
prgmZOBJECTS
If S=1:Then
X→V
Y→W
Y+8→Y
Goto DR
Else
Goto ZZ
End
End
If K=24:Then
Y/8→U
(X-8)/8→T
prgmZOBJECTS
If S=1
Then
Y→W
X→V
X-8→X
Goto DR
Else
Goto ZZ
End
End
If K=26:Then
Y/8→U
(X+8)/8→T
prgmZOBJECTS
If S=1
Then
Y→W
X→V
X+8→X
Goto DR
Else
Goto ZZ
End
End
If K=22
ClrDraw
ClrHome
Disp "Thanks for","Playing"
Return
Lbl DR
If X>80
Then
80→X
Ans→V
Goto ZZ
Else:If X<8
Then
8→X
Ans→V
Goto ZZ
Else:If Y>48
Then
48→Y
Ans→W
Goto ZZ
Else:If Y<8
Then
8→Y
Ans→W
Goto ZZ
End
real(1,V,W,1,8,0,1,0,3,0,0
real(1,X,Y,1,8,0,1,0,0,0,1
Goto ZZ
ZOBJECTS (Collision detection subroutine)
Code:
If [A](U+1,T+1)=0
Then
1→S
Else
0→S
End
Return
Now, I have NO doubt this could be HIGHLY optimized, but for now, Im trying to find the memory leak(s) and speed up what I have so far.
This is part of Null RPG (my upcoming game). So any help would be GREATLY appreciated!
Here is a link to my post for it:
Null RPG