MAKING A RADAR

2

Attached Files

The following files have been attached to this tutorial:

.capx

simpleradar.capx

Download now 83.02 KB

Stats

4,985 visits, 9,046 views

Tools

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Published on 16 May, 2013. Last updated 19 Feb, 2019

Here is a great radar that shows where the enemies are compared to your position.

It may help if you use the .capx while doing this tutorial.

Layers

First of all, your going to need two layers with the proper paralex.

Name the first layer "game" setting the paralex to "100,100" then name the second layer "radar" and set the paralex to"0,0".

Basic objects

Now lets make the basic objects needed on the proper layers for this tutorial.

Were going no need enemies and a player put these on layer game,

and we need a radar(Make sure the collision shape is the how you want the radar and the point of origin is where you want the player to be represented) then make a small sprite to represent the enemies on the radar put both of these on layer radar.

Ok now lets get the code done be careful because this is the easiest area to mess up.

Here's a pic of the code

Making radar points

This is how we make sure we have enough dots.

Add a condition if (enemy.count>radardot.count) with an action (create object-radardot)

Radarpoint marking

This is the special piece of code I designed to track the enemies on the radar

add a condition (pick everyinstance enemy) with an action (set radardot.x to (enemy.x-player.x)0.05+radar.x set radardot.y to (enemy.y-player.y)0.05+radar.y)

_Be careful not to pick repeat for every instance because that does not work you must Choose pick every instance

Destroying dots

Now this will make sure you do not have to many dots

add a condition (on enemy destroyed)with an action (radardot destroy)

Only showing dots on the radar

This is how you get only the dots on the radar to appear

Choose condition (if radardot is overlapping radar) with an action(then set radar dot visible),and condition(if radardot is overlapping radar)-inverted then(set radar dot invisable)

Hope you enjoyed this and i' d love to see you guys spread the news and show me what your using it for

heres an exaple game on the arcade

.CAPX

simpleradar.capx

Download now 83.02 KB
  • 1 Comments

  • Order by
Want to leave a comment? Login or Register an account!
  • Hi, Thanks for this excellent tutorial. I'm a bit of a noob, so please go easy - HAHA! My question is, I'd like to spawn in waves. So 1st wave would be only 3 zombies spawn... etc. Can this be done? I've tried a few things but not been successful.

    Thanks,

    Roberto