What Wick Editor Version are you using?
I use 1.19.3
Describe the Problem
I’m making a rpg type game and I can’t make it so that the character stops when it hits something.
What Wick Editor Version are you using?
I use 1.19.3
Describe the Problem
I’m making a rpg type game and I can’t make it so that the character stops when it hits something.
You could make a “hits” function to check if the player is touching some things.
There are other ways but i’m not really experieced with rpgs, same with platformers.
Click me to download the example! I managed to hack this together, when the Player hits Slayer, The player will be sent back a bit, though if you want you can customize this, just a peek at the code can tell you about it! Press the right arrow key to move the player.
Example 2! I also made a version that changes the frames of the clips when player gets sent back! @KennyP
Steps:
[1] draw object1 and convert it into a clip, then name it object1 or the name that makes more sense to your application.
[2] draw object2 and convert it into a clip, then name it object2 or the name that makes more sense to your application.
[3] Place object1 at the left and and object2 at right of the stage.
[4] Add an Update Script to object1
[5] Under that Update tab, write the following code:
this.speed = 5;
if(this.hits(object2) {
this.speed = 0;
}
this.x += this.speed;
“this.x += speed;” doesn’t work
Fixed. Thank you… it needs the this.
this.speed = 5;
if(this.hits(object2) {
this.speed = 0;
}
this.x += this.speed;
can you clarify?
Did you check out the new example
just saw it now lol i’ll try it in a little bit
aaaaaaayyyyyyyyyyy it worked! thx!