functions ?

Get help using Construct 3!

Post » Sun Jul 09, 2017 10:26 pm

hey all im making a space game with a mining laser
now heres what i want to do
when my mouse is over and i clicked the asteroid i want to start the laser BUT when my mouse exit the asteroid i want to stop the mining laser for good until i redo it is there a way for it ?
B
27
S
9
G
3
Posts: 136
Reputation: 3,750

Post » Sun Jul 09, 2017 11:15 pm

On asteroid clicked > start mining
Mouse cursor is not over asteroid > stop mining
B
46
S
16
G
74
Posts: 2,089
Reputation: 44,187

Post » Sun Jul 09, 2017 11:21 pm

plinkie wrote:On asteroid clicked > start mining
Mouse cursor is not over asteroid > stop mining

as a function ?
or as a finite state machine
B
27
S
9
G
3
Posts: 136
Reputation: 3,750

Post » Sun Jul 09, 2017 11:29 pm

wut? as 2 events. That should work.
B
46
S
16
G
74
Posts: 2,089
Reputation: 44,187

Post » Mon Jul 10, 2017 6:15 am

got a way better solution

:D

+ System: On start of layout
-> System: Set group "Mining" Deactivated
+ Mouse: On Left button Clicked on Asteroid
+ Mouse: Cursor is over Asteroid
-> System: Set group "Mining" Activated
-> Audio: Play SFX6 not looping at volume 0 dB (tag "laser-start")
-> System: Wait 0.11 seconds
-> Audio: Play LaserLoop2 looping at volume -5 dB (tag "laser-loop")

+ Mouse: [X] Cursor is over Asteroid
-> System: Set group "Mining" Deactivated
B
27
S
9
G
3
Posts: 136
Reputation: 3,750

Post » Mon Jul 10, 2017 7:51 am

Isn't that the same solution?
B
46
S
16
G
74
Posts: 2,089
Reputation: 44,187

Post » Tue Jul 11, 2017 4:18 am

yes. yes it is.
B
22
S
12
G
1
Posts: 108
Reputation: 2,774


Return to How do I...?

Who is online

Users browsing this forum: No registered users and 1 guest