2 commands with same key

Get help using Construct 2

Post » Thu Mar 08, 2012 1:58 am

[QUOTE=Yann] set timescale to 1-timescale[/QUOTE]


B
28
S
8
G
1
Posts: 469
Reputation: 4,683

Post » Thu Mar 08, 2012 4:35 am

[QUOTE=Yann] no need for trinary operator you can just to
On P Pressed -> set timescale to 1-timescale

'cause
1- 1 = 0
1- 0 = 1[/QUOTE]
-This is madness!
-Madness?

-THIS IS... CLEVER!!! 01lifeleft2012-03-08 04:36:27
B
34
S
8
G
5
Posts: 174
Reputation: 5,791

Post » Thu Mar 08, 2012 7:17 pm

Thanks everybody i feel better now :)
B
10
S
3
G
3
Posts: 54
Reputation: 3,317

Post » Wed Apr 10, 2013 9:52 am

Hi,

I've come up with a simple solution that should apply for all instances of using the same key to pause and unpause. It should also work for any other toggle or toggleable events that you might need.

I've included an image here to show you what it's like: http://i.imgur.com/NI1oOAJ.jpg

If that image doesn't come through then here's the basics:

1) Create a Global Variable and set it to 0

2) here's the way I input the actions

| System Every Tick
     | Keyboard on [Key] pressed
        | System [Global Variable] = 0 : Toggles an action, like pause or creating an object etc.
        |                             : Set [Global Variable] to 1
        | System Else                  : un-toggles any previous action, or does a new set of actions.
        |                             : Set [Global Variable] to 0


That's the basic skeleton. The program will check to see if the variable is 0 or not 0 and will take action based on that. It will be a toggle-able event as long as you remember to reset the Global Variable each time.

I hope that's clear enough.





thinkpadius2013-04-10 09:52:39
B
6
S
2
Posts: 6
Reputation: 871

Previous

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 1 guest