I wish to make a soul box like in undertale and deltarune for a fan game im working on, but the soul won’t stay within the box. and also, if you can help how can i make the TP bar?
What is the expected result
The soul stays in the battle box
What is the actual result
the soul can escape freely and i can’t force it to stay within its boundaries.
Change position of your soul on X add TimeDelta() * 40
Check if its too fast or too slow and adjust that 40 to match how fast soul should move
After you have that magic number
Make Variable call it Speed and set that variable to TimeDelta * your number
And now make 4 events
1
Condition
Left key is pressed
Action
Change X position of soul SET TO max(Soul.X() - Speed, Box.X())
2
Condition
Right key is pressed
Action
Change X position of soul SET TO min(Soul.X() + Soul.Width() + Speed, Box.BoundingBoxRight())
3
Condition
Up key is pressed
Action
Change Y position of soul SET TO max(Soul.Y() - Speed, Box.Y())
4
Condition
Down key is pressed
Action
Change Y position of soul SET TO min(Soul.Y() + Soul.Height() + Speed, Box.BoundingBoxBottom())