some help

Get help using Construct 2

Post » Wed Jan 16, 2013 6:33 am

Im currently making an asteroids game.

I want to put an "hyperspace" function that teleports your ship to an area of the layout that doesnt have any asteroid "safe zone".

Any ideas on how can i do that?
Is there a function to detect if there is an object in a certain position?

Ty for the help
B
8
S
2
Posts: 30
Reputation: 1,543

Post » Wed Jan 16, 2013 5:17 pm

BUMP
B
8
S
2
Posts: 30
Reputation: 1,543

Post » Wed Jan 16, 2013 8:42 pm

BUMP
B
8
S
2
Posts: 30
Reputation: 1,543

Post » Wed Jan 16, 2013 8:48 pm

No need for bumping so much in a day... anyway, on the 2nd or 3rd page I found - http://www.scirra.com/forum/on-start-of-layout-loops-logic-collsions_topic61745_post379018.html

Should help you..
B
15
S
5
G
7
Posts: 877
Reputation: 5,650

Post » Wed Jan 16, 2013 8:53 pm

ummm

function"movePlayer"
Pick Nth "asteroid"    floor(random(0, asteroid.count))
-> set player.x = asteroid.x + whatever, player.y = asteroid.y + whatever


on start of layout[[or however when player starts in area]]
call function "move player"

if player is overlapping
call function "movePlayer


just a thought. procrastinator is right. Please give it a day. Different times zones, jobs, special events all contribute to different reasons for a response that isn't in a few minutes. Some times you will get lucky, other times it could take days. hmm, I should bump my scenegraph suggestion. it's been about 2 weeks :D
B
87
S
18
G
9
Posts: 2,455
Reputation: 14,834

Post » Thu Jan 17, 2013 6:00 am

I did it. Ty for the help guys.

Just for the record, I did what jayderyu said. But I also used an invisible SafeZone to check if the player was visible in the screen. I also had to check if there was at least one asteroid with all the conditions because my code was throwing javascript errors.
B
8
S
2
Posts: 30
Reputation: 1,543


Return to How do I....?

Who is online

Users browsing this forum: Colludium, LaroTaio and 27 guests