Coming soon - Get a detailed view of why an account is flagged as spam!
view details

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.

3
Collisions / HP
Post Flair (click to view more posts with a particular flair)
Post Body

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;

Author
Account Strength
90%
Account Age
6 years
Verified Email
Yes
Verified Flair
No
Total Karma
3,486
Link Karma
959
Comment Karma
2,378
Profile updated: 2 days ago
Posts updated: 7 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
3 years ago