How can we generate spikes in and around cirle

Just started using Construct 2? Post your questions here

Post » Tue May 09, 2017 8:07 am

Hi

How can we generate spikes in and around the circle randomly as in dangerous circle kind of game.Please help me.
Tanks in advance
B
22
S
8
G
1
Posts: 32
Reputation: 2,064

Post » Tue May 09, 2017 8:16 am

Hi @ramyaswetha,

Spawn the spike at the centre of the circle.
On spike created, apply a random rotation using the set angle random(360), then move the spike the circle radius using the move forward action.
B
20
S
8
G
3
Posts: 458
Reputation: 4,055

Post » Tue May 09, 2017 8:26 am

Hi
Could you please make a sample capx for me please
B
22
S
8
G
1
Posts: 32
Reputation: 2,064

Post » Tue May 09, 2017 8:53 am

@ramyaswetha

Here you go:

https://www.dropbox.com/s/mihsnimbt3vws ... .capx?dl=0

Hope that helps :)
B
20
S
8
G
3
Posts: 458
Reputation: 4,055

Post » Tue May 09, 2017 9:50 am

thank you so much
B
22
S
8
G
1
Posts: 32
Reputation: 2,064

Post » Tue May 09, 2017 9:56 am

@ramyaswetha You're welcome :)
B
20
S
8
G
3
Posts: 458
Reputation: 4,055

Post » Tue May 09, 2017 10:50 am

but the spikes are not getting generated randomly and the spikes should also generated inside the circle also same as in dangerous circle game
B
22
S
8
G
1
Posts: 32
Reputation: 2,064

Post » Wed May 10, 2017 11:55 am

@ramyaswetha

I've updated the demo to be more like the game you referenced - haven't heard of it before! :)
You can modify the speed of the avatar, flip the avatar in/out, randomise the spike direction and step up/down circle rotation, all at runtime.

Change the global variable spikeTotal to modify number of spikes, circleRadius to modify the circle size and OriginX,OriginY to change the starting position.

I've not included collision or the fade effect on the spikes.

https://www.dropbox.com/s/mihsnimbt3vws ... .capx?dl=0
B
20
S
8
G
3
Posts: 458
Reputation: 4,055


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 3 guests