Spawning Q's

For questions about using Classic.

Post » Sun Mar 07, 2010 3:29 pm

I am struggling with spawning, I am so close but missing something. How do you have a single sprite spawn from any angle of the screen like in Asteroids?

Thanks
B
28
S
8
G
8
Posts: 530
Reputation: 7,154

Post » Sun Mar 07, 2010 5:28 pm

[code:1f7xfqg9]+ Every 2000 ms
++ random(2) = 1
>> System: Create Asteroid at random(2)*DisplayWidth, random(DisplayHeight)
++ Else
>> System: Create Asteroid at random(DisplayWidth), random(2)*DisplayHeight[/code:1f7xfqg9]

Theoretically, this should randomly pick horizontal or vertical edges and randomly create an asteroid on one of those edges.
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Sun Mar 07, 2010 5:35 pm

http://dl.dropbox.com/u/4322334/spawner.cap

This spawns objects outside layout in a ring, pointing to the center of the layout.
B
2
S
1
G
4
Posts: 71
Reputation: 1,342

Post » Sun Mar 07, 2010 8:55 pm

Porlo that is exactly what I was looking for

My mistake was I was using: Spite/Creation/ Spawn another Object/ ( Select Sprite Name)

Instead of: System/Create Object From/Object ( Select Sprite Name)

So when you use the Spawn another Object?
B
28
S
8
G
8
Posts: 530
Reputation: 7,154

Post » Sun Mar 07, 2010 9:49 pm

Well, i've never needed it...
B
2
S
1
G
4
Posts: 71
Reputation: 1,342

Post » Tue Mar 09, 2010 7:12 am

I did something like what Mipey said but more like
[code:3tpycea7]+ Every 2000 ms
++ random(2) = 1
>> System: Create Asteroid at 0, random(DisplayHeight)
++ Else
>> System: Create Asteroid at random(DisplayWidth), 0[/code:3tpycea7]
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 10 guests