Animation with gamemaker?

Neo-Axis, Torque, 3D GameStudio, DarkBasic, Blitz3d, ect...
User avatar
Jesusfreak
Posts: 231
Joined: Mon Jun 08, 2009 1:43 pm

Re: Animation with gamemaker?

Post by Jesusfreak »

Ok, thanks. I made my official noob label like Noctrine suggested by the way, is this what you had in mind? :lol:

EDIT: Didn't work. It wouldn't go left, the animation didn't go, and intstead of moving the object, it created a bunch of new ones wherever the original went. I'ma go look at the wiki and see what the codes I'm using actually mean...
if (sprite_index == spr_canonleft1)
{
with (instance_create(x,y, obj_canon))
{
direction = 180;
speed = 4;
}
}
if (sprite_index == spr_canon)
{
with (instance_create(x,y, obj_canon))
{
direction = 0;
speed = 4;
}
}
if (sprite_index == spr_canonleft2)
{
with (instance_create(x,y, obj_canon))
{
direction = 180;
speed = 4;
}
}
if (sprite_index == spr_canon2)
{
with (instance_create(x,y, obj_canon))
{
direction = 0;
speed = 4;
}
}
EDIT2: Ah, I see it, the "instance_create" code creates a new instance, what I need is the code for changing the sprite. Lemme see if I can find that...
Image
_-= Official Noob Label -=_
For those with self esteem like mine =).
User avatar
hallsofvallhalla
Site Admin
Posts: 12031
Joined: Wed Apr 22, 2009 11:29 pm

Re: Animation with gamemaker?

Post by hallsofvallhalla »

the code still works great, test out my gamemaker game i made in the project show off topic named fantasy heroes, i used this same code.

just take out the instance create
if (sprite_index == spr_canonleft1)
{
direction = 180;
speed = 4;
}

if (sprite_index == spr_canon)
{
direction = 0;
speed = 4;
}
if (sprite_index == spr_canonleft2)
{
direction = 180;
speed = 4;
}
if (sprite_index == spr_canon2)
{
direction = 0;
speed = 4;
}
and you must make a sprite change with the direction action...

so if keyboard = left change sprite to left_sprite
User avatar
Jesusfreak
Posts: 231
Joined: Mon Jun 08, 2009 1:43 pm

Re: Animation with gamemaker?

Post by Jesusfreak »

Well, the canon moves properly now, but the animation still doesn't work o_O.

Does it matter that my character is a canon with spinning wheels rather than a guy walking?

The way I have my sprites is that each direction has 3 versions, each with the wheels slightly different, and it cycles through the sprites as it moves. Or, well, it's supposed to :) .

EDIT: Maybe it'd help if I actually knew what this code was doing...
The code essentially says, "If the sprite is such and such, then move at speed 4 in a certain direction," right?
Last edited by Jesusfreak on Thu Jul 02, 2009 9:01 pm, edited 1 time in total.
Image
_-= Official Noob Label -=_
For those with self esteem like mine =).
User avatar
hallsofvallhalla
Site Admin
Posts: 12031
Joined: Wed Apr 22, 2009 11:29 pm

Re: Animation with gamemaker?

Post by hallsofvallhalla »

so you have a action with each arrow key press right?

with that action is a sprite change, that is the index mentioned above,
User avatar
Jesusfreak
Posts: 231
Joined: Mon Jun 08, 2009 1:43 pm

Re: Animation with gamemaker?

Post by Jesusfreak »

(I would have responded a few days ago but I decided not to bother you guys for a while)

It didn't work. The character only moves right and the animation doesn't occur.

How do I upload the file so you can see what I did wrong?
Image
_-= Official Noob Label -=_
For those with self esteem like mine =).
User avatar
Sakar
Posts: 520
Joined: Thu Apr 23, 2009 2:59 am

Re: Animation with gamemaker?

Post by Sakar »

Upload the gmk file to something like File-Pasta and give us a link.
User avatar
Jesusfreak
Posts: 231
Joined: Mon Jun 08, 2009 1:43 pm

Re: Animation with gamemaker?

Post by Jesusfreak »

http://file-pasta.com/home/jesusfreak/#1

Does it work?

(It might be a while before I respond, my head hurts... been reading too much... :roll: )
Image
_-= Official Noob Label -=_
For those with self esteem like mine =).
User avatar
Warriorccc0
Posts: 92
Joined: Thu Jun 18, 2009 5:37 am

Re: Animation with gamemaker?

Post by Warriorccc0 »

Whats wrong with just using the moving, and changing sprite action?
User avatar
Jesusfreak
Posts: 231
Joined: Mon Jun 08, 2009 1:43 pm

Re: Animation with gamemaker?

Post by Jesusfreak »

I haven't the slightest clue... it'd be easier to answer if I knew what the code Halls gave me actually did :lol: .

What is the code necessary for, Halls?
Image
_-= Official Noob Label -=_
For those with self esteem like mine =).
User avatar
hallsofvallhalla
Site Admin
Posts: 12031
Joined: Wed Apr 22, 2009 11:29 pm

Re: Animation with gamemaker?

Post by hallsofvallhalla »

it moves the character...........
Post Reply

Return to “3d Engines”