Calculator Community > The Axe Parser Project
Flickering Text (and collision?)
Xeda112358:
Haha, no problem, and I merged those posts together.
The code looks like it should work. So for an optimization, if you draw the sprite with XOR logic, then DispGraph, then re-draw with XOR logic, then you won't have to ClrDraw to remove the sprites. (It's like doing a pxl-change/DispGraph/pxl-change)
So what about the text? You can draw the initial score before the loop, and after that, only re-draw the score when you increment D.
Drawing text can be slow, so only drawing it when needed will save a lot of time in your loop.
EDIT: clarified what xor/disp/xor was doing
Joey H.:
I'm certainly learning a lot here!
Among all of this, how might I add a system which responds when there is a collision between this "block" (what you have to dodge) and the character doing the dodging?
Will this slow it down a lot or is there a better way than how I'm approaching it?:
--- Code: ---If B>44
If A>(X-8) and A<(X+8)
Pt-Off(X,Y,Pic3)
Goto D
End
End
--- End code ---
B is the Y coord. of the block, X is the X of the character, A is the X of the block
Xeda112358:
That is probably the simplest and fastest method and shouldn't slow it down much, but there might be order-of-operations issues, so you might need:
--- Code: ---If (A>(X-8)) and (A<(X+8))
--- End code ---
Alternatively:
--- Code: ---If (A-X>-8) and (A-X<8)
--- End code ---
But for Axe, that can probably be optimized to:
--- Code: ---If A-X+7 < 15
--- End code ---
(This is taking advantage of "negative" numbers actually being really large, so you don't need to make sure A-X+7>=0. If it was "smaller" than zero, it would actually be around 65000 which is not less than 15 :P)
Joey H.:
Whoa! You're good!
Well, Thank you very much, that's all for now!
Thanks!!!
Navigation
[0] Message Index
[*] Previous page
Go to full version