Random X,Y of new object

Get help using Construct 2

Post » Mon Dec 30, 2013 6:53 am

Hi,

I am just testing out the system and have set up a simple action/event that has a new enemy sprite created every 2 seconds. I set the randomization to 500.

This is a two-fold question.

1. Is it possible to set the randomization to fit the users screen size?

2. Is it possible to make sure the enemy doesn't spawn too close to my player? Pretty frustrating if the enemy spawns right next to you...

Thanks guys!
B
5
S
1
Posts: 44
Reputation: 465

Post » Mon Dec 30, 2013 7:09 am

To fit the users screen size you could use viewportright-viewportleft-viewportbottom-viewporttop in your events.

To not make the enemy spawn too close to the player you could make an condition system comapre two values : distance(playerx,playery,enemyx,enemyy) > 100
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775


Return to How do I....?

Who is online

Users browsing this forum: ametueraspirant, dand, mickclarke and 33 guests