Page 1 of 3

Animation with gamemaker?

Posted: Wed Jul 01, 2009 8:42 pm
by Jesusfreak
Should be a pretty simple question. How do I make animations on gamemaker, ie, a walking animation? Do I just have it change sprite and then change back?
Also, how do I make an AI that changes directions randomly? I don't seem to be very good at doing randomizations with multiple outcomes for some reason...

Re: Animation with gamemaker?

Posted: Wed Jul 01, 2009 9:18 pm
by towcar
The Sprite Animation:
You have a normal Sprite just standing there..
When you Press -> Arrow it should move right
So you have it change to the sprite with walking animation. Which can be put in the the object part of the editor

So in the Sprite section in the editor you make ex: Player Walking
With playerwalking you can set up your sprite walking by making multiple frames.



I never did get that far into gamemaker to answer the second one, maybe do something with path finding?

Re: Animation with gamemaker?

Posted: Wed Jul 01, 2009 10:27 pm
by Jesusfreak
Ok, thanks, I guess that'll work...

New problem: I can't draw :? . Gah... I can draw simple symmetrical figures like the jet thingy, but how do I draw actual characters?

Re: Animation with gamemaker?

Posted: Wed Jul 01, 2009 11:58 pm
by Raven67854
#JesusFreak
I dunno learn? I can't draw at all. But if you use this nifty site called Google. It can most probably teach you how :).

Re: Animation with gamemaker?

Posted: Thu Jul 02, 2009 1:31 pm
by Jesusfreak
Hmm... is it possible for the game to detect where you have your mouse? Or can it just detect clicks?

Re: Animation with gamemaker?

Posted: Thu Jul 02, 2009 1:36 pm
by hallsofvallhalla
i am sure it has Mouse_x and a mouse_y and a mouse_down fuctions

Re: Animation with gamemaker?

Posted: Thu Jul 02, 2009 4:50 pm
by Jesusfreak
So I'll have to get into the source code to do things like that? About time I started using actual code, I guess.

How do I actually start coding? Is there a way I can enable it? Or do I just use the action to insert code whenever I need code?
As for learning the code, it's probably somewhere in the wiki...

Re: Animation with gamemaker?

Posted: Thu Jul 02, 2009 5:12 pm
by Noctrine
Google? I mean seriously, we enjoy helping you but holding your hand throughout the entire thing isn't fun. Its what n00b labels are made for. (And not fake ones like Kyr, but real ones)

Re: Animation with gamemaker?

Posted: Thu Jul 02, 2009 5:43 pm
by Raven67854
GOOGLE

Now all you gotta do is click the link 8-).

Re: Animation with gamemaker?

Posted: Thu Jul 02, 2009 7:09 pm
by hallsofvallhalla
yes you can use the action code then enter this in it

Code: Select all

if (sprite_index == *main sprites name standing left*)
{
with (instance_create(x,y,*objects name*))
{
direction = 180;
speed = 8;
}
}
if (sprite_index == *main sprites name standing right*)
{
with (instance_create(x,y,*objects name*))
{
direction = 0;
speed = 8;
}
}
if (sprite_index == *main sprites name running left*)
{
with (instance_create(x,y,*objects name*))
{
direction = 180;
speed = 8;
}
}
if (sprite_index == *main sprites name running right*)
{
with (instance_create(x,y,*objects name*))
{
direction = 0;
speed = 8;
}
} 
make your sprites 3 animations long and put each frame of walking in each animation frame....