You beat the boss, and now it's about to explode in classic Metal Slug fashion. How do I spawn these explosions on random points of the sprite?
I understand I can use the (ciel ----) thing coupled with actual Image Points, but I was wondering if it's possible to just spawn randomly on the sprite without the need of creating tons of image points.
You could use the Bounding Box as border.
https://drive.google.com/file/d/0B5FlDY ... sp=sharing
You could use the Bounding Box as border. https://drive.google.com/file/d/0B5FlDY ... sp=sharing
I'm not sure I understand, I was wondering if it's possible to spawn another object at a random point on a sprite without the need for Image Points.
every 0.5 seconds
create sprite at
x: random(bossSprite.BboxLeft,bossSprite.BboxRight)
y: random(bossSprite.BboxTop,bossSprite.BboxBottom)
something like that should work.
Sweet, thanks for the advice! I'll give it a shot.
May I ask if you can further explain what exactly it does, for newbies? You won't learn anything if you're just given the straight answer ^-^
Bbox is the x and y values of the outer edges of the sprite.
Keep in mind though that if your sprite is rotated the Bbox will still be at the Outer edge surrounding the sprite.
If you have a square and and rotate it 45 degrees to something like this shape.. <> then the Bbox will still be a standing square at the edges of the rotated sprite. like this. [<>] hope that helps.
Develop games in your browser. Powerful, performant & highly capable.
Worked perfectly, thank you very much.
Everything is pretty self-explanatory minus the BboxLeft/Right/Top/Bottom thing. What do these refer to? Seems handy.
EDIT: I see you've responded, thank you very much! Very good explanation, thank you