Game like angry birds

Monkey Forums/Monkey Programming/Game like angry birds

wiliamtn(Posted 2013) [#1]
Hi guys want to make a game like angry birds, which apply a force at a given point and angle and the object moves at that angle.

I do not know how to do this, I know only move objects in straight axes X or Y.

Can anyone help me?


therevills(Posted 2013) [#2]
Have a look at the 2D physics modules like Box2D:

https://code.google.com/p/monkeybox2d/


Gerry Quinn(Posted 2013) [#3]
For something like Angry Birds, a physics module is definitely best.

If you are just firing a missile, you can do it "by hand". Basically, you need a little bit of trigonometry.

Say you want to move from (0,0) and go 10 units at a 30 degree angle. Your new position is ( 10 * Cos( 30 ), 10 * Sin( 30 ) )


Amon(Posted 2013) [#4]
Not meaning to put down Box2D but it's a configuration/implementation nightmare.

Surely there is an easier way to do things with Box2D or better yet a different physics module with a better method of being set up?


AdamRedwoods(Posted 2013) [#5]
a different physics module with a better method of being set up?

Muddy also did a Fling port which has a better API (IMO) but is not optimized for android/java.
http://monkeycoder.co.nz/Community/post.php?topic=5938&post=67783


muddy_shoes(Posted 2013) [#6]
Box2d isn't that different from any other general-purpose physics lib in its API. It's reasonably arguable that it's the de-facto standard for such things. Simulation setup is necessarily a little bit verbose in order to allow for all the flexibility required.

For most purposes you'll end up writing another layer for your game/editor that hides much of the detail. There are also any number of wrappers/toolkits/editors out there that you could potentially use (with a bit of work to convert to monkey or load their file format). I believe that CopperCircle wrote a higher level wrapper in Monkey that might do what you want.

A lot of complaints I hear about using Box2d are rooted in some thought that you shouldn't have to understand the physics involved to use it. Unfortunately there's not much that can be done to avoid the need to comprehend how a prismatic joint, for example, works before you can just type in the config that will achieve your desired result.