Legacy GM Animation for the bird

River

Member
Hey there! This is a my first post here and i'm new Gamemaker so I got the basic question about making game by using Game maker engine, hope everyone can help or explain this problem well enough for me. Thanks so much!
Now, i'm making the small project that the bird can fly (randomly) and after this bird can perch bird and eating something with full animations. How can I do it?
 
C

Cupid Stunt

Guest
Do you see the bird from the side or from the top?
 

River

Member
Do you see the bird from the side or from the top?
Yes, it is top-down view. How i can do it such as: what's about create? and in step what's things I need to do? Sorry, because I', newbies here so I need anybody can help for creating coding. Thank :)
 

NightFrost

Member
You'll need some sprite animations too, but I suppose you already have that in plans. It looks like your entity will have multiple behaviors. Usually this means the basic structure should be built with a coding practise called state machines. It separates code for each state into their own block and has a variable that describes the current behavior state. For your bird, the structure would go something like:
Code:
// CREATE Event

// Define all states.
enum Bird_State {
   Perch,     // Bird is sitting idle.
   Eat,       // Bird animates eating.
   Fly        // Bird flies around and animates flight.
}

// Define starting state
State = Bird_State.Perch;

// STEP Event

if(State == Bird_State.Perch){
   // Code here that controls perching and can switch the bird to eat or fly states.
}
else if(State == Bird_State.Eat){
   // Code here that controls eating and can switch the bird to perch state.
}
else if(State == Bird_State.Fly){
   // Code here that controls flight and can switch the bird to perch state.
}
It should be easy to find more GMS code specific use case examples by googling around a bit.
 
Top