Stencyl 3.4.0 is now out. Get it now!

Stop actor from sliding down when on 45 degrees angle tiles [SOLVED]

nikopol

  • Posts: 26
Hey,

So the problem is pretty much explained in the title. How can I do this without increasing friction ? (since it would make it harder to walk up slopes)

« Last Edit: March 21, 2017, 07:46:56 am by nikopol »

LIBERADO

  • *
  • Posts: 2493
Set the friction to 0 when the player is pressing any key to move the actor.
Set the friction to 1 when the player is not pressing any key to move the actor.
   
<a href="http://static.stencyl.com/games/36296-0.swf" target="_blank" class="new_win">http://static.stencyl.com/games/36296-0.swf</a>

« Last Edit: March 20, 2017, 08:18:25 pm by LIBERADO »
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

squeeb

  • Posts: 1143
Genius.. haha.. I was trying to think that one out for a bit

nikopol

  • Posts: 26
Awesome, solved my problem !

Didn't know we could interact with friction from outside the 'physics' tab

LIBERADO

  • *
  • Posts: 2493
Didn't know we could interact with friction from outside the 'physics' tab
Yes. And you can even set the friction to a value higher than 1
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

bubbadubc

  • *
  • Posts: 16
In addition to the title post, there is the rotating actor staying lined up with the tiles.
Could someone breakdown how to do that for me please?

LIBERADO

  • *
  • Posts: 2493
@bubbadubc, use the Tile Metadata.
You can tag tiles with textual data that can be accessed during game.
Type in this field the angle toward which the actor must face when touching each tile:

             

Then, from a collision event, access this data by using this block:
And rotate the actor according to the value of such data.

More info: http://www.stencyl.com/help/view/tiles/

« Last Edit: November 18, 2017, 10:09:46 am by LIBERADO »
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

bubbadubc

  • *
  • Posts: 16
@bubbadubc, use the Tile Metadata.
You can tag tiles with textual data that can be accessed during game.
Type in this field the angle toward which the actor must face when touching each tile:

             

Then, from a collision event, access this data by using this block:
And rotate the actor according to the value of such data.

More info: http://www.stencyl.com/help/view/tiles/

That is way beyond me, but I'll get to reading and see if I can figure it out. Thanks a bunch!

JeffreyDriver

  • Posts: 1311
@bubbadubc, use the Tile Metadata.
You can tag tiles with textual data that can be accessed during game.
Type in this field the angle toward which the actor must face when touching each tile:

             

Then, from a collision event, access this data by using this block:
And rotate the actor according to the value of such data.

More info: http://www.stencyl.com/help/view/tiles/

That is way beyond me, but I'll get to reading and see if I can figure it out. Thanks a bunch!

This isn't as difficult as it first seems. You simply enter text to recall later. For instance, you can enter a description of the tile. E.g. water, slope, lava etc. and when your player collides just check the data: IF data of collided tile = water

bubbadubc

  • *
  • Posts: 16
So, I label my slopes (I only have 1 angle)
and then I tell my actor,
"if, data of collided tile" = "slope" > "rotate (some degrees)"
"otherwise" > "rotate 0"

? Is this what you're telling me?

LIBERADO

  • *
  • Posts: 2493
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

bubbadubc

  • *
  • Posts: 16
Well thank you!
I'll try it out and let you know if it works for me.