Ball physics and birds! actionman

Whee~
I'm pretty bad at making topics, so here goes...


HELLO,
I recently cancelled my RpgMaker project because I got bored of it, and other reasons, and wanted to make something short and easy. So I decided to make a platformer in GM8
The concept synopsis: You control a small flock of birds as they try to roll a ball through a 2D sidescrolling platformer.There are some other random annoyances (enemies, gaps, ect)
What I need help with is scripting - or eventing, or anything that gets me through. I want to create smooth, realistic ball physics of it rolling. This means...
  • Momentum: rolling down a hill speeds it up, pulling a ball speeds it up, going uphill or friction slows it down gradually
  • Flying: As in the ball can fly through air from a jump, but be pulled down by gravity
  • Collision: Hitting objects on the ground or midair stops/slows the ball
  • Bouncing: Hitting objects midair will obviously cause the object to recoil a bit (in whatever direction) as well as falling and hitting th ground will make it bounce. Hitting a 45° slope while flying 90° will make you fly 0° (but obviously lose momentum)

I was told this is actually an easy thing to do, but I couldn't find any tutorials on how to do it, and I have no experience with GM, so I need help.

Second, I want a flock of to follow the mouse like in a particle engine. Then, whenever you click on something you can interact with, they will fly toward it. But I want the birds to be independent animations so they appear real. Any good particle engines that could do this?


Thats it for now,
I would really appreciate some help - I need it D:
-action man
well I dont have GM on right now so let me give you the basics:

First off, look for the GM tutorial on how to make a platform game and do it, even if it is repetitive its something you just need to do and it helps a lot. It should answer a few of your questions. With that said:

  • In terms momentum on a hill, that might be something you want to look up especially with the ball method. To set gravity you simply go to your player's object and set gravity. Im pretty sure there is a friction event as well.
  • With flying you set the movement up but you want it to be relative so there is control. If gravity is set on the object then this should be fine
  • Solids already collide with other solids. Also just a tip dont make a sprite for every background image and whatnot, make a tileset and then import it as a background. Then click it and you can set up a tileset from there. This saves you tons of time. Look it up.
  • There is also a bounce event as well but I have never tested it with gravity though

Like I said do the tutorials and play around. This program is a steep program to use and takes a lot of time before you even are able to produce something crappy. You can't give up on this program, this isn't RPG maker where you continually get better as you go along. Its a steep curve and you have to climb instead of tread.

In terms of scripting that is something you just need to research and learn, no one can teach this for you. The help guide in this program is really good however and gives you some basics and codes you can use for basic commands. Look up some scripts and see how to code. Though, I recommend you play around with events first before trying this.
I'm looking toward GMPhysics atm. Seems to do what I need it to do. Just need to figure out how to do it.
Well, doesn't seem to work like I hoped. Found something else in replacement, but it's not perfect.
http://gmc.yoyogames.com/index.php?showtopic=454810
If you place the ball on flat land, it sometimes just bounces.. You also can't change the gravity, or else it will just bounce on flat land. And lastly, the transition from bouncing is too jagged.

:\


I later changed the script in the colision event of the ball and object one to
  1. bo=0
  2. for(ii=-88; ii<88; ii+=4){
  3. if(place_free(x+lengthdir_x(speed,direction+ii),y+lengthdir_y(speed,direction+ii))){
  4. direction+=ii
  5. ii=99
  6. if hspeed > 0
  7. if speed > 1
  8. image_angle = image_angle+-speed
  9. if hspeed < 0
  10. if speed > 1
  11. image_angle = image_angle+speed
  12. exit}}
  13.  
  14. bo=1
  15.  
Expand to see the code.



Also I messed around a bit later and found that sometimes the ball sticks to the walls when done bouncing for some reason. Anyone got any ideas to clean up the code?
if you want post the project and Ill see what I can do with it but no guarantees
If you meant the project file, then here it is:
http://webgel.net/bb/files/ball%20rolling.gmk

Original thread: https://www.hbgames.org/forums/viewtopic.php?t=73169