This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
I have an emitter (obj_shooter) that pops out a number of balls (obj_ball) based on level, etc. The collide with any number of objects for this case (obj_block) For simplicity sake, think of the mobile game ballz. The problem I have is that the obj_ball(s) collide with the first obj_block they encounter, decreases the HP and bounces off like it's supposed to. Say it takes 2 balls to kill the block, first two hit it and it destroys itself, the balls go on to hit other blocks and none of the other decrease the HP. I'm new to Gamemake and GML but not to programing so it's probably something really obvious I'm missing.
obj_shooter -- alarm[0]
if(spawn_count < spawn_amount)
{
instance_create_depth(x,y,-1,obj_ball);
spawn_count ;
alarm[0] = spawn_rate;
}
No problems spitting the balls out.
obj_ball -- step
if(place_meeting(x hspeed, y, obj_invisWall))
direction = -direction 180;
if (place_meeting(x, y vspeed, obj_invisWall))
direction = -direction;
if(place_meeting(x hspeed, y, obj_block))
direction = -direction 180;
if (place_meeting(x, y vspeed, obj_block))
direction = -direction;
obj_ball has no problem bouncing around
obj_block
Create:
level = global.playerlevel;
hp = 1 irandom(level);
textWidth = 128;
lineHeight = 18;
Step:
textToShow = string(hp);
if(hp <= 0)
{
instance_destroy();
}
Collision obj_ball:
hp -= 1;
Subreddit
Post Details
- Posted
- 3 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/gamemaker/c...