• Hey! Guest! The 36th GMC Jam will take place between February 27th, 12:00 UTC - March 2nd, 12:00 UTC. Why not join in! Click here to find out more!

Legacy GM issue with object sprite not stopping if player is not touching

EZTALES

Member
hey yall, (video below)
was wondering if anyone could help me with this. I am trying to replicate a game called fire for my game and the problem is when the little man falls out of the burning building it doesn't matter if he is touching a player or not, the sprite continues to play out. also what i wanted is when you don't make it in time to help out the little man it would make your miss bar go up one and reset the image_index on little man to 0. I haven't set anything up but if anyone could give me an idea of what to type in that would be great! a video is down below showing what I mean. if anyone could help me out I would greatly appreciate it.
 

EZTALES

Member
Post the code of falling man and I will try to help you.
heresthe step event. again, im not so great at gamemaker but it. it kind of works, but in the end it ends up working 50/50 percent of the time.
Code:
if image_index = 3 && not place_meeting (x,y, obj_fire_player)
{
image_index = 0;
}
 

Edwin

Member
heresthe step event. again, im not so great at gamemaker but it. it kind of works, but in the end it ends up working 50/50 percent of the time.
Code:
if image_index = 3 && not place_meeting (x,y, obj_fire_player)
{
image_index = 0;
}
It works only if image index equals to 3 and Im pretty sure there is more image indexes. Can you show me the falling man's frames in image editor so i can know what on frames he can collide with the player?

it looks like this
Безымянный.png
 

EZTALES

Member
It works only if image index equals to 3 and I'm pretty sure there are more image indexes. Can you show me the falling man's frames in an image editor so I can know what on frames he can collide with the player?

here you are, the issue being that I want it too only have to touch the falling man 1 time and not have to wait for it to go to the next sprite, otherwise, it just restarts back to the first image. if you want I can show you in a video
View attachment 24452
 

Attachments

EZTALES

Member
It works only if image index equals to 3 and I'm pretty sure there are more image indexes. Can you show me the falling man's frames in an image editor so I can know what on frames he can collide with the player?

it looks like this
View attachment 24452
the problem still persists, around 1:04 in my video is how it should be working, I doubled each sprite for a falling man just to let you know but the real problem is is that after a while, the collisions go out the window and stop working. any idea how to fix this? code is here.
Code:
STEP EVENT
/// no collision with fire player;
if image_index = 4 && not place_meeting (x,y, obj_fire_player )
{
image_index = 0;
}
if image_index = 12 && not place_meeting (x,y, obj_fire_player)
{
image_index = 0;
}
if image_index = 16 && not place_meeting (x,y, obj_fire_player)
{
image_index = 0;
}
 

TheouAegis

Member
What is the image_speed? Is it 0 and you are manually increasing image_index, or do you set image_speed to animate the sprite automatically?
 

EZTALES

Member
Set it to 0.125 and see if the glitch goes away.
another question i have is points, i have set up a simple points system (code down below) but the issue is when the falling man is colliding with the fireman, it gives too many points because the falling man collides with the fireman for too long, is there a way i could make it so when the falling man touches the fireman it only gives 1 point?
this is my code for the score, its fairly simple, thanks!
Code:
(obj_fire_points)
(CREATE)
global.firepoints = 0;
(STEP)
draw_set_color(c_white);
draw_set_font(font_one);
draw_text(64,32,global.firepoints);
(obj_fire_player)
(COLLIDE WITH FALLING MAN)
global.firepoints += 0.1;
EDIT got it working nm sorry for the trouble
thanks for the help!
 
Last edited:
Top