Calculator Community > Doodle Jump

DoodleJump Discussion

<< < (2/43) > >>

AngelFish:

--- Quote from: Mohammad on December 09, 2010, 06:37:12 pm ---ive been working on doodlejump for the calculator for about a week now. i thought it would be a great idea and i did it and added sound...however its only halfway complete but already addictive and attractive...i think i've took it to a point where all that is missing is the monsters and shooting.btw..do not steal my idea to make doodlejump!
...
3a. How do i make a projectile follow a parabolic path (in Ti-Basic you can do Pt-On(34.56,x2+2x+C) but in axe its all integer numbers so i cant do Line(2.5,3.5,4.5,1/3...i think thats a major downfall...)
3b.How do i make a ball/bullet follow a linear path(line) that is at any angle...basically how can i make a pixel follow a linear equation?
4. major question here...this will solve problem 3 for me...wheres the precious int( command? how do i know if a number is even without going ":if A/2=int(A/2"? how can i do int(3.45x+3) in axe?


--- End quote ---

I think I saw a topic labeled DoodleJump around here recently...

Anyway, the main difference between Axe and BASIC is that there are no decimals in Axe. None at all [barring Assembly work]. The easiest way to have projectile motion is to forget about realistic numbers and realize that you're working on a pixelated screen. Thus, you can give objects vectors in the form of moving a certain number of pixels per frame. Thus, a ball with no horizontal motion might move 0 pixels left or right, but could drop a constant 3 pixels per frame or something.This also solves the linear path problem because all you would have to do is set the position change variables constant. If you want to get into acceleration, that's also possible, but it requires some additional steps.

nemo:
to start, no one is stealing your idea to make doodlejump. to be frank, doodle jump has been at least partially ported in axe already. if i want to make a doodle jump clone, i will.
alright... many questions. i'll start with the first.
1. use some of the free RAM areas. use L1. so {L1} contains the first bullet's X pos, {L1+1} is the Y pos. {L1+2} is the second bullet's x pos, {L1+3} likewise.
2. you cannot. well, you *can*, but it's not really worth the trouble.
3a. this is the one i feel confident in explaining. when division occurs, the remainder is truncated. 1/3 produces 0. 5/6 produces 0. 7/6 makes 1. this is only a downfall if you plan on making a math program. in which case, you shouldn't be programming in axe, you should be programming in TI-Basic. i'll give a code snippet to make a black square jump up and down when you press [2nd]. horizontal movement i'll leave up to you. basically, you need a velocity variable and a position variable. you also need a number. we'll pick 16. the screen is 96 pixels wide and 64 tall. as you said, you can't display something at .5 of a pixel. so, we must enlarge the screen. if our screen were 192 pixels tall and 128 tall, we'd technically be able to place a sprite at twice the precision as if the screen was 96 by 64. therefore, our X and Y position variable is going to be twice as large right? why don't we just pretend? let's say the screen is 96*16 pixels wide, and 64*16 tall. then, everytime you add 1 to your X position, you are technically moving it by 1/16th of a pixel.

--- Code: ---ClrDraw
[FFFFFFFFFFFFFFFF]->Pic1
Line(0->V,58,96,58)
800->Y
Repeat getKey(15)
If Y=800 and getKey(54) // if there's no velocity and you press [2nd]
20->V                      //increase that velocity.
End
If Y-V->Y<800                   //collision detection here
V-1->V
Else
0->V
End
Pt-Change(8,Y/16,Pic1)
DispGraph
Pt-Change(8,Y/16,Pic1)
End

--- End code ---

question 3b will be answered once i recall my knowledge of the sin/cos routines.

AngelFish:

--- Quote from: nemo on December 09, 2010, 07:23:48 pm ---
question 3b will be answered once i recall my knowledge of the sin/cos routines.

--- End quote ---

Hint: They return a value between 0 and 255 and are normal otherwise.

squidgetx:
don't forget the numbers are signed: -127 to 127. Also, if you want to use degrees, you will have to multiply all your angles by 32/45 before running them through the sin/cos routines because their period is 256 instead of 360

nemo:

--- Quote from: Qwerty.55 on December 09, 2010, 07:26:05 pm ---
--- Quote from: nemo on December 09, 2010, 07:23:48 pm ---
question 3b will be answered once i recall my knowledge of the sin/cos routines.

--- End quote ---

Hint: They return a value between 0 and 255 and are normal otherwise.

--- End quote ---
no, they return a value between -127 to 127. and they are not normal otherwise. they have a period of 256, not 2pi.

also, i was thinking of the problem of making a routine which retains a constant speed while being able to change your direction. linear bullets are easy because you just have an x velocity and y velocity, like michael lee said.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version