How Do I have Enemies spawn on screen off player?

Get help using Construct 2

Post » Sat Dec 05, 2015 7:05 am

I have tried many things, from adding or subtracting the Players position to the randomization of X,Y but this puts the Enemies in walls And/or Off the Screen, Anyone have any Ideas on what equation might work?, PlatformGame, keep in mind i'm using specific cords for randomization.
Ex: Random(672,1216)
B
4
Posts: 2
Reputation: 208

Post » Sat Dec 05, 2015 10:48 am

Would using the viewportleft(), viewportright(), viewporttop() and viewportbottom() expressions help?

For example adding an action like:

Enemy on created
Enemy is overlapping wall
- enemy destroy
- system create enemy at x= random(viewportleft(0)+enemy.width,viewportright(0)-enemy.width)

Would prevent the wall overlapping.
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

Post » Tue Dec 08, 2015 7:35 am

Thanks man! Life savior on my game!
B
4
Posts: 2
Reputation: 208


Return to How do I....?

Who is online

Users browsing this forum: CJacobsSA, dustinboyle, JohannesLudwing and 2 guests