Need help with figuring out the maths for spawning position

Just started using Construct 2? Post your questions here

Post » Thu Feb 19, 2015 11:34 pm

Hi there,

right now, I'm working on a mod of the tutorial base game. My biggest change right now is the implementation of a way tougher boss monster every 30 seconds. As I already modded the base monsters to basically spawn randomly off screen and enter the screen from all directions (did so by writing 4 events which spawn monsters, one for each direction), I also want the boss to not be too predictable. What I was essentially trying to do was along the lines of:

X: Random(either on the left or the right of the screen)
Y: Random(either on top or below the screen)

so that I basically create a spawn zone around the screen. But I'm lacking the syntax to do so.
Any idea how to do that?
B
2
Posts: 1
Reputation: 152

Post » Fri Feb 20, 2015 4:25 am

an easier way would be to have 4 instances of a sprite (top, bottom, left and right of the screen) and every 30 secs, pick random sprite, spawn boss.

you can check my old tutorial on asteroids, where teh asteroids spawn (almost) randomly following the same principle.

https://www.youtube.com/watch?v=wJ1h9HPhb4I
Image
B
58
S
13
G
6
Posts: 271
Reputation: 12,128

Post » Fri Feb 20, 2015 9:29 am

Playable games:
http://jamesxxxyz.newgrounds.com/
Newest: Blue and red arrows
Latest update: Blue and red arrows

What you want in C3?
viewtopic.php?f=146&t=122050

Youtube: https://www.youtube.com/channel/UCLE7Ml ... /playlists
B
11
S
4
Posts: 281
Reputation: 1,543


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 6 guests