0 Members and 1 Guest are viewing this topic.
simple. Repeat getKey(15) //make sure the program quits when you press {Clear}ClrDrawrryour greyscale sprite goes hereDispGraphrryour sprite movement control goes hereEndI know that it's not optimized, but it'll do.
Yes, *256 inflation is used for physics, which allows the player to move at 1/256 of a pixel at a time.
No, when you display it, you do /256, which means that you have to add 512 to the value in order to move 2 pixels. It's kind of hard to explain it in a condensed form, I'd try looking at some of the many physics tutorials.
Quote from: parserp on September 07, 2012, 09:54:10 pmNo, when you display it, you do /256, which means that you have to add 512 to the value in order to move 2 pixels. It's kind of hard to explain it in a condensed form, I'd try looking at some of the many physics tutorials. K, and this is used in pretty much all physics right?
Quote from: Link on September 07, 2012, 09:54:59 pmQuote from: parserp on September 07, 2012, 09:54:10 pmNo, when you display it, you do /256, which means that you have to add 512 to the value in order to move 2 pixels. It's kind of hard to explain it in a condensed form, I'd try looking at some of the many physics tutorials. K, and this is used in pretty much all physics right?It's certainly the most optimized number for position inflation. In fact, since Axe is big-endian, instead of doing VAR/256, you can do {°VAR+1}. This method also has a lot of uses outside of physics, too.
:.A:AsmComp(SPEEDKEY):[7E81BD817E18183C]→Pic1:[7EFFC3FF7E18183C]→Pic2:ClrDraw{^r}{^r}:0→X→Y:While 1:Zoom Out→A:Pt-Off(X/256,Y/256,Pic1):Pt-Off(X/256,Y/256,Pic2){^r}:DispGraphClrDraw{^r}{^r}:If A=1:Y--:End:If A=2:X--:End:If A=3:X++:End:If A=4:Y++:End:EndIf getKey(15)
Hmm, well I tried this according to what yeong said: but it isn't working? Whats wrong >.>Code: [Select]:.A:AsmComp(SPEEDKEY):[7E81BD817E18183C]→Pic1:[7EFFC3FF7E18183C]→Pic2:ClrDraw{^r}{^r}:0→X→Y:While 1:Zoom Out→A:Pt-Off(X/256,Y/256,Pic1):Pt-Off(X/256,Y/256,Pic2){^r}:DispGraphClrDraw{^r}{^r}:If A=1:Y--:End:If A=2:X--:End:If A=3:X++:End:If A=4:Y++:End:EndIf getKey(15)