Jump to content

Handling Infernal wall moving


Recommended Posts

Posted (edited)

You mean this bit? https://youtu.be/17ITEUEIP5Y?t=3965

 

You could have a series of coords, e.g.

| ----------------- | ---------------- | ------------------ |

x1,y,z                  x2,y,z                  x3,y,z                    x4,y,z

And then:

If wall x is > x1 & my player x is <= x1, move player to x2

If wall x is > x2 & my player x is <= x2, move player to x3

If wall x is > x3 & my player x is <= x3, move player to x4

etc. etc. etc. for however many points it takes for the motion to be fluid, and your player to follow the wall.

The same applies for when the wall reaches the end, and flips direction:

If wall x is < x4 & my player x is >= x4, move player to x3

If wall x is < x3 & my player x is >= x3, move player to x2

If wall x is < x2 & my player x is >= x2, move player to x1

You wouldn't necessarily program that as a series of if statements, this is just a general idea of the logic.

 

Edited by Explv
Posted
39 minutes ago, Explv said:

You mean this bit? https://youtu.be/17ITEUEIP5Y?t=3965

 

You could have a series of coords, e.g.

| ----------------- | ---------------- | ------------------ |

x1,y,z                  x2,y,z                  x3,y,z                    x4,y,z

And then:

If wall x is > x1 & my player x is <= x1, move player to x2

If wall x is > x2 & my player x is <= x2, move player to x3

If wall x is > x3 & my player x is <= x3, move player to x4

etc. etc. etc. for however many points it takes for the motion to be fluid, and your player to follow the wall.

The same applies for when the wall reaches the end, and flips direction:

If wall x is < x4 & my player x is >= x4, move player to x3

If wall x is < x3 & my player x is >= x3, move player to x2

If wall x is < x2 & my player x is >= x2, move player to x1

You wouldn't necessarily program that as a series of if statements, this is just a general idea of the logic.

 

Thanks for this. It's very helpful! Has all the information i need!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...