In Construct first frame indexing as frame 0
When clicked set animationFrame to abs(Sprite.animationFrame-1) or (Sprite.animationFrame+1)%2
> Offline login (matching keyword): dropbox.com/scl/fi/htwm06lgjto8h4t8gbp7h/login.capx
Local Hi-scores: dropbox.com/scl/fi/dba7yw6876u841mbnll3m/contoh_highscore.capx
It is: dropbox.com/scl/fi/w6mjtd46p994n4dguweat/4-direction-press-touch.capx
Second array? If the name is Array2 you can just set it Array2.At(0, random(Array.Height)) for example.
Sure not every condition can be passed to expression, yet that some common programming practice can be performed with proper expression writing. Sometimes I want to put complex ternary in one line some other time I'll just do straight event sheeting.
Set value to:
Array.At(0, random(Array.Height)) for 0 index column
Array.At(1, random(Array.Height)) for 1 index column
Array.At(2, random(Array.Height)) for 2 index column
In expression you directly assign value to specific attribute. The comparison can be anything but it needs to be put into a value/property/attribute. works just like if else condition (ternary) even nested one. So yes everything were put in action and you can leave the condition blank or under certain condition.
https://ibb.co.com/zx36X9D[/img]
A prove: dropbox.com/scl/fi/vclxylb1wz8yuu8t9ho2n/ternary_and_or.c3p
Of course you can put & operator for adding extra condition in expression. For mirrored the expression using width parameter but negative (-width).
Develop games in your browser. Powerful, performant & highly capable.
You probably want to use Ternary operator to put action based on several criteria under single event like what I do in following case: onicstudios.wordpress.com/2021/02/04/formula-that-moves-object-efficiently
Try search on forum with keyword 'ternary' so you will end up with relevant topics.
The most extreme use case I came up with is this one:
dropbox.com/scl/fi/tj43mky0cinrz7516migo/moving_up.capx
Well yes maybe not directly but hopefully you find some logic about matching letter basically. One of them is by utilizing tokenat expression for checking contained character.
Here typing game example by me: dropbox.com/scl/fi/0tysjlf5b94u42isb8hmd/typingGame.capx
Wow another shot and we love alternative way get things done. Nice!
Member since 22 Feb, 2012