Jump to content

Handling Infernal wall moving


vaynex

Recommended Posts

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
Link to comment
Share on other sites

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!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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