0 Members and 2 Guests are viewing this topic.
sorry to double post, but could you go in depth on the jumping part and what you are doing in the code? thats the part i need, thanks
How does the pixeltesting work in this?
.I'm going to use Y for Y_Position and E for Y_Velocity.So every frame, put this line in somewhere:Y+E->Y.And add a constant to EE+100->E.100 is a pretty good number for 256x inflation
100 for Y acceleration? I'm using 12 for gravity...…
I get all that stuff, I just can't get it to pxl test when I come down on a plat form..
no I have all that. like it jumps and moves, but if I put in a line as a plat form, the sprite jumps through it instead of landing on it...I think I is cuz it is adding and subtracting multiple numbers from the sprites position...
:.assuming that Y is your Y position and E is your Y velocity:.and that your sprite is [FFFFFFFFFFFFFFFF]:.and that X is your X position::Repeat GetKey(15):ClrDraw:Y+E->Y::If E>>0 //if your velocity is negative:sub(TEST) //subroutine that sees if there is platform:End::E+100->E::.the rest of your code (jumping, etc.):End //end main loop::Lbl TEST:For(B,((Y/256)-(E/256)+8),((Y/256)+8:For(A,(X/256),(X/256)+7:If pxl-Test(A,B:0->E:((B*256)-2048)->Y:Return:End:End:End:Return
Sorry to be a super n00b, but what does >> mean? For example: X>>12. Also, I've never understood for loops, what are the 3 arguments?
:For(A,0,3) //loops through 4 times:Disp A>Dec //displays the value of A (see how it changes?):End