- Game Maker Community
- → Viewing Profile: Posts: Osaifh
Osaifh
Member Since 05 Jul 2012Offline Last Active Jul 05 2012 11:24 PM
Community Stats
- Group New Member
- Active Posts 9
- Profile Views 170
- Member Title GMC Member
- Age Age Unknown
- Birthday Birthday Unknown
-
Gender
Not Telling
-
Version
GM8
Friends
Osaifh hasn't added any friends yet.
Posts I've Made
In Topic: Problems about diferent parametres for one object
05 July 2012 - 10:35 PM
In Topic: Problems about diferent parametres for one object
05 July 2012 - 10:08 PM
In Topic: Problems about diferent parametres for one object
05 July 2012 - 09:28 PM
Ok, so I made diferent variables acording to whatever has the tank to do. First, I set a variable called "movement", it's default value is 0. When it's 0, it draws the tank stopped. When I press up, it changes to 1, meaning that it's now being drawn the moving sprite. When I release up, it changes back to 0. The same thing happens with down, but the down value is 2Alright, you'll need to create an additional variable for that. Continue to use sprite_index for the tank body's sprite, draw_self() will handle the rest.
Then, create a separate variable called "turret_sprite" or something in the create event of the tank object and set it to spr_turret. Whenever the turret shoots, instead of setting sprite_index to spr_turret_shooting (or whatever), set turret_sprite to spr_turret_shooting and set it back to spr_turret once it's done shooting. turret_sprite can now be used as the "sprite" argument of draw_sprite_ext, as it will hold the ID of the turret's current sprite, like this:draw_sprite_ext(turret_sprite, 0, x, y, 1, 1, point_direction(x, y, mouse_x, mouse_y), c_white, 1); //Then, draw the turret on top of it.
With the turret, I'm going to create two variables: one can be 0 or 1, 0 for the draw event to draw the turret in it's normal state, and 1 for when it's shooting, and another that can be true or false. When it shoots, it's changed to true. Then there will be an "animation end" event, that when it ends, if the second variable is true, it will change it to false and the first one to 0.
Am I doing it right?
EDIT: wait, I doubt the "animation end" stuff would work, because the sprite is not the animation... oh ****, it wouldn't work. Help please, again
In Topic: Problems about diferent parametres for one object
05 July 2012 - 09:11 PM
In Topic: (D&D) Moving an instance between rooms
05 July 2012 - 08:55 PM
- Game Maker Community
- → Viewing Profile: Posts: Osaifh
- Privacy Policy
- GMC Rules and Forum Rules ·



Find content