Can you give an example?
There are some expressions you can use. For example:
set result to chooseindex(var, "foo", "bar", "baz")
set result to (var=0 ? "foo" : var=1 ? "bar" : "baz")
In 3d game you would probably want the sprite to rotate in the direction it moves?
This looks like a bug with the debugger or perhaps Physics behavior. If you can reproduce it in a small project, you need to report it:
github.com/Scirra/Construct-bugs/issues
Develop games in your browser. Powerful, performant & highly capable.
Yes:
dropbox.com/scl/fi/gonddmmsgblpgc9o63ctp/ShakeDetection.c3p
Set Rendering mode=2D in HUD layer properties.
The way we did this in Moonstone Island was by placing a semi-transparent copy of the character sprite on a layer above. Or you can paste it on a drawing canvas. It won't be dark though:
The trees are not transparent.
Now how do I mark a post as the solution?
You can edit the subject if you wish, but it's not really necessary.
There are lots of examples and tutorials
construct.net/en/tutorials/direction-based-sprite-251
construct.net/en/tutorials/direction-animation-503
construct.net/en/tutorials/animation-management-8-712
You do not have permission to view this post
Check out the official example:
editor.construct.net
But it's not very good because it doesn't detect touch speed, only the direction between start and end point. Meaning you can randomly move the finger around the screen for a long time and it will still detect it as a swipe.
A better way to do this is to use Touch.SpeedAt(0) and Touch.AngleAt(0) expressions
dropbox.com/s/gk6xktdvn0p9cn0/SwipeControls.c3p
Yes, self.a instead of just "a", but you need to copy/paste this entire expression:
(anglediff(self.a, 0)<45 ? "Right": anglediff(self.a, 90)<45 ? "Down": anglediff(self.a, 180)<45 ? "Left": "Up")
It's using ternary operators and is a short and efficient way to do this:
If angle is near 0 degrees - use "Right" animation else If angle is near 90 degrees - use "Down" animation else If angle is near 180 degrees - use "Left" animation else use "Up" animation
Check out these links:
howtoconstructdemos.com/visible-field-of-view-fov-in-a-top-down-game-like-a-flashlight-beam-capx
howtoconstructdemos.com/improved-stealth-game-template-how-to-make-a-visible-cone-of-view
There is also an official example in C3 called Stealth Game.
Member since 26 May, 2016