Hi all, I'm working on an endless scroller much like Jetpack Joyride. I have an enemy who comes from the right of the screen to the left of the screen quickly and need to warn the player that the enemy is coming. Much like the image below shows. How can I create a warning that appears when that enemy is about to appear? Thanks!
Hi @Dan, welcome to the forum. There are a few ways you can do it, depending on the parameters and variable of your game, which there can be many. I'll try and keep it brief. The two obvious choices would be with either audio, visuals, or indeed both. With audio, you could have your character collide with an action, that triggers an mp3 with the warning sound of your choice. With a visual warning, you could use either collide with a decoration object that is a set distance away from your oncoming enemy, (if your enemy is always in a fixed position), or your could attach an object to your enemy that collides with you, but doesn't kill you. Set it up to use the attached objects defeated animation as a visual warning that the enemy will follow very quickly soon after. The attached enemy object would be set to -1 opacity (invisible) so you would not see it and could be something like 500 pixels in front of (left of) your enemy, this way, if your enemy enters the screen at random points, you always have a set distance warning. Plus, you could change that distance to make some enemies harder or easier than other. Some food for thought. Oh, I just thought of another one, you could set the enemy to wake up at a set distance and activate a sound that way, so even if it's off screen to the right around 600px or so, you dcould wake it up just prior to entering the screen. As ever on the forums, try and provide as much info about your game (or better still a bbdoc demo), as folks will be able to assist you much better when they have more info to go on. Good luck
Thanks @Phill Mason I like having both audio and visual cues. The idea of attaching the enemy to the visual cue is nice especially with setting different distances. I'll give that a shot. Thanks again!