Would you play Angry Birds if you had it on your calculator?
Yes
 100%  [ 19 ]
No
 0%  [ 0 ]
Total Votes : 19

I am currently working on a port of the Angry Birds game to the calculator. So far, I have finished the graphics(which are not very good, I will freely admit) and am trying to figure out the physics for this game

To do
Get better graphics
Figure out physics
Gravity
Air resistance
Hitting a object

Would anyone be willing to help?
I don't know if this helps, but here is a simple animation:

Code:

DelVar ADelVar BClrDraw
1->D:8->C
Repeat A>=57
Text(iPart(A),iPart(B),"o
A+D->A
B+C->B
C-.05->C
D+1->D
End

it starts from the top left, and then follows an arc downwards (simulating a ball being thrown sideways, with gravity affecting it).

ofcourse, you can change some numbers around to change the arc.
Thanks, Michael! Much appreciated.
Not trying to be negative about it, but I don't think it's possible to get the speed and processing power required for advanced physics with ti-basic, especially if you have a lot of objects that all collide with each other. Sad
Assembly would be a little better for this. If this is in the monochrome, I would recommend axe, easy to learn and there are already some physics engines for this. Graphics and calculations are very fast, definitely fast enough for a few objects to not look laggy.
I know that it will be very slow, but that does not discourage me.
I would be willing to help you Caleb. How good do you want the physics?
I would recommend Axe though, it would be good for a nice physics game.
Also, I forgot to put this code I made, still, it shows just how similar it is to basic, with just a few more commands:

Code:
.AA
0->X
0->T
10->Y
Repeat getKey(15)
 X++
 Y+T->Y
 T++
 If X=96
  0->X
 End
 If Y>58
  ~10->T
 End
 Circle(X,Y,3)
 DispGraphClrDraw
 Pause 64
End

and I even added a delay because it was too fast.
here's a screenie

(it's just a visual glitch from jstified)
I would like the physics to be relatively good. I just want the bird to curve as it goes through the air and when it hits a pillar, it falls down/ takes damage.
Caleb, I would suggest trying to learn axe before attemping this project. The added speed would make it great!
The only problem with me learning Axe is that I don't have a monochrome calculator.
Since you are trying to do this on the CSE, I think I would like to try it for monochrome calculators. Razz My other project is going a little slow, so I may try to make this game beforehand. Maybe. I'll think about doing it Wink

Edit:
Nvm... I thought about it, also looked at the physics library that someone else already made, saw that it was impossible for objects to rotate in his lib, and I don't feel like making one myself, especially one that complicated. Sad
I found this on ticalc, but it runs fairly slow, even though it pretty much only includes shooting and detection for if you hit the pig.
It's a start. Now I have somewhere to start off of. Thanks, Michael!

Code:

Code:
6->A
2->B
Radian
AxesOff
FnOff
0->Xmin
94->Xmax
1->Xscl
0->Ymin
62->Ymax
1->Yscl
ClrHome
ClrDraw
Text(17,20,"ANGRY BIRDS V 1.0"

Text(47,32,"BY BIOHAX"

Pause
Lbl theta
0->theta
0->I
ClrDraw
randInt(15,90)->P
randInt(15,60)->Q
While 0<1
If I=0
Then
Text(57,1,"NEW    EXIT"
Horizontal 6
Circle(P,Q,3)
Text(45,8,"Y")
Else
Text(50,0,"        ")
Text(45,0,"        ")
End

Line(B,A,8,16)
While theta=0
getKey->theta
End
If theta=11
Then
Goto theta
End
If theta=12
Then
ClrDraw
FnOn
ZStandard
AxesOn
ClrHome
Stop
End
If theta=25 and A<15
Then
A+1->A
End
If theta=34 and 6<A
Then
A-1->A
End
If theta=24 and 0<B
Then
B-1->B
End
If theta=26 and B<6
Then
B+1->B
End
1->I
If theta=21 or theta=105
Then
tan^-1((16-A)/(8-B))->C

sqrt(((16-A)^2)+(8-B)^2)->D

8->X
While X<94
"tan(C)(X-8)-(2(X-8)^2)/(3.5(D^2)cos(C)^2)+16"->Str1
expr(Str1)->Y
If X<=(P+3) and X>=(P-3) and Y<=(Q+3) and Y>=(Q-3)
Then
ClrDraw
Text(28,15,"YOU KILLED THE PIG"
0->I
0->theta
Pause
ClrDraw
Goto theta
End

Pt-On(X,Y)
X+2->X
End
ClrDraw
0->I
End
0->theta
End
Goto theta


Time to start optimizing.....
Are you still working on this?
"ultimate necropost" bump

I have decided to start working on this again, now that I've written a few more programs, and know a few more things about graphics.

To do list (revised)

Create sprites
Figure out how to make a arc depending on the firing angle and power
Start going from there.
I did some quick Googling, and there are plenty of tutorials online that explain simple projectile motion with an initial velocity and angle, and fixed gravity. I strongly recommend you take a look at some of them. Have you learned algebra yet? If so, then you have all the basis you need to understand projectile motion.
I am certainly willing to help!

You can define an arc using this:


Code:
Delvar [X]Delvar [Y]sin([Angle]->[VelocityX]
cos([Angle]->[VelocityY]
// Main loop
While 1
[X]+[VelocityX]->[X]
[Y]+[VelocityY]->[Y]
// 0 < [AirFriction] < 1
[VelocityX]*[AirFriction]->[VelocityX]
[VelocityY]-[Gravity]->[VelocityY]
End
Very nice, Nik. Just from a quick glance that looks like it should work Smile Just need to add the display

If you think about it really simply:
the lower the angle, the less y velocity and the more x velocity.
the higher the angle, the more y velocity and the less x velocity.
of course, that also depends on the power.

You also have gravity, which if you're trying to be realistic, would make the y velocity decelerate at 9.8 meters per second, which is basically what you have, Nik. Of course, if you're trying to simulate other planets or are just wanting a custom gravity, you can plug that number in as well, as long as it looks good on the game (as long it is not too quick of a fall).
Kerm: Yes, I know algebra.

And for the arc, I know how to calculate that. My equation of choice is:
2v^2*sin(theta)*cos(theta))/g

g=9.8 m/s^2
v= initial velocity
y=starting height (will be 2)
theta= angle relative to the ground, which will be completely horizontal.

V will depend on how far back you draw the slingshot. Or would it be 0?

The difficult part is coding in something that will make the bird fall down, and whatever it hit to move/die.
Would anyone mind helping me write a algorithm that will Pxl-Test in front of the point (that will be the bird, for now) so it can be checked for collision?
I guess you have a wrong equation, because y becomes larger with a larger x, and I don't think that is your intention.

I hope this helps:

Code:
10->V // starting velocity
9.8->G
For(A,0,10,.1
Pt-On(T,VT-.5GT^2
End
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 2
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement