Tutorial Downloads

File Size
simpleradar.capx83KB

Translations

Know another language? Translate this tutorial!

Stats

1,768 visitors
15.4K page views
402 translation visitors
2,131 translation page views

a enemie tracking radar

Favourite 77 favourites
Tutorial written by sosensibleOriginally published on 16th, May 2013 - 13 revisions

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

Unlock your full gamedev potential

Upgrade to the Personal Edition of Construct 2, it has way more features and won't holding back from making money and using your full creativity like the free edition does. It's a one off payment and all Construct 2 editor updates are free for life!

View deals

Plus, it's got a lot of additional features that will help you save time and make more impressive games!

Congratulations on finishing this tutorial!

Did you learn a lot from it? Share it now with your friends!

Share and Copy this Tutorial

You are free to copy, distribute, transmit and adapt this work with correct attribution. Click for more info.

Comments

4
softjuarez 3,450 rep

Great tutorial!!!

Thursday, May 16, 2013 at 9:07:24 PM
4
Tedg 9,889 rep

Thank you for share this.

Thursday, May 16, 2013 at 9:12:16 PM
1
sosensible 10.3k rep

thanks for the feed back
if tutorial is a little confusing I do have a file you can veiw

Thursday, May 16, 2013 at 9:19:05 PM
1
sosensible 10.3k rep

also if you remove the part about the players position and replace the enemies with characters(players) it will give you a map instead of a radar

Thursday, May 16, 2013 at 10:28:27 PM
4
tyfricko 6,590 rep

Wow, great tut...

Thank you

Friday, May 17, 2013 at 8:26:37 AM
4
Lordshiva1948 43.9k rep

yes very nice, Thank you for sharing this

Friday, May 17, 2013 at 8:33:02 AM
4
AbelaNET 14.9k rep

Great Tutorial. Thanks

Friday, May 17, 2013 at 8:28:46 PM
4
Pixel perfick 12.3k rep

Nice one, thanks for this...

Monday, May 20, 2013 at 9:58:37 AM
4
pikofarad 1,632 rep

Nice and perfect tutorial. Thank u.

Monday, May 27, 2013 at 10:26:05 AM
2
ParCutz 3,092 rep

Wonderful. I love to learn and thanks to you, I did.

Wednesday, June 26, 2013 at 12:00:52 AM
0
sosensible 10.3k rep

thanks every body 10 favorites

Friday, June 28, 2013 at 1:54:41 PM
1
irina 6,752 rep

cant download/open CAPX !?

Friday, June 28, 2013 at 2:49:11 PM
-1
sosensible 10.3k rep

try a different browser? i'm guessing your using Firefox doesn't seem to work in it

Saturday, June 29, 2013 at 1:52:12 PM
2
Blacksmith 8,282 rep

Nice work, simple and easy to follow! Thanks sosensible :)

Saturday, June 29, 2013 at 2:38:46 PM
-1
sosensible 10.3k rep

sorry irina I cant fix problems scirra has on their site

Sunday, June 30, 2013 at 2:11:00 PM

Leave a comment

Everyone is welcome to leave their thoughts! Register a new account or login.