YesNoOk
avatar

Looking for a code to make the camera move all the time (literally) (Read 2124 times)

Started by ziaker, September 14, 2019, 12:58:31 am
Share this topic:
Looking for a code to make the camera move all the time (literally)
#1  September 14, 2019, 12:58:31 am
  • *
    • Brazil
something like this




and anyone can teach me how to create and use VARS?
I couldn't understand in any way how to create one and use it. Every tutorial I saw did not clarify my questions and still failed to make me understand. I'd be happy if someone taught me how to create a var and use a var
Re: Looking for a code to make the camera move all the time (literally)
#2  September 14, 2019, 02:30:40 am
  • ****
    • crepa.neocities.org
For the camera thing, the author of the video explained how he did it in a comment and even posted the code, but this won't work well in the middle of the fight, it could work for bonus stages where the player 2 doesn't make the camera move.

For vars, you don't "create" them, they are already in the char but they all start as 0, what you do is create situations to turn them into any other number. Var stands for "variable", a variable number you can use for anything. This is basically what a var is, there is not much to explain. A good example of using a var is to detect which button you press:

[State 1000, Button Detect]
type = VarSet
trigger1 = !Time
var(10) = ifelse(command = "x", 0, ifelse(command = "y"), 1, 2))

The code above says: if I press light punch button, var(10) will be 0, if I press medium punch, it will be 1, if I press heavy punch, it will be 2. Then you can use this to define velocities, damage, etc. that the char should use according to the variable.

There is a specific topic here that explains variables better.