Know another language? Translate this tutorial!
670 visitors13.2K page views
In this tutorial I'll show you how to create offscreen enemy indicators. Click here for a demonstration.We'll modify the Ghost Shooter tutorial example so open the examples folder from the start page and load up 'Ghost Shooter (tutorial version).capx'.The first thing we'll do is create a new layer for the indicators. We'll call it 'Indicators' and place it between the 'Main' and 'UI' layers.Double-click on the layout and insert a sprite called 'Indicator'. Here is the image to use: Now, onto the event sheet.
First we'll delete the existing indicator at the start of the layout. Then we'll use a loop to create an indicator for each monster.Add a new action to the 'On start of layout' event:Then create a new sub-event and add the condition:And the action:We also have to make sure we create a new indicator whenever a monster is created and destroy one when a monster is destroyed.We'll just destroy a random indicator when the monster is killed. Find the event where the monsters are destroyed and add a sub-event:Open full size imageAdd a system condition:and a destroy indicator action same as in the 'On start of layout' event.
Create an indicator when a monster is spawned. Find the event where monsters are spawned and add a create monster action the same way as before.
Did you learn a lot from it? Share it now with your friends!
Nice tutorial ramones, very insightful.
Awesome tutorial, this is very good solution to make indicators!
Hey, there is a weird glitch where the indicators get stuck and dont stay on screen.
Thank you, I needed this for my game. Good stuff.
Nice & helpfull, big tnx!
So won't the arrows just appear at the same x and y values as the mobs?Wouldn't it be better to draw a line between the player and the mob and where the line intersects the border, you draw an arrow pointing towards the mob?Of course you don't have to draw an actual line (you could just use maths), but that is the principle.
Everyone is welcome to leave their thoughts! Register a new account or login.