Hi again! This is my second post, here I go.
File
drive.google.com/file/d/1h5dOkxy9Zl3sSgn95PnwoeiZ1vB14uhC/view
Commands: A key, D key and Space bar key.
Reference
I'm inspiring myself on Dandara jump mechanics:
youtu.be/POXlm2t6zZA
My intent
Right now my main issue is the Pointer's angle. I want obj_PlayerPointer to have it's angle automatically set to an angle that has the same angle difference to the current landing area it had in the previous landing area. Plus I want to happen as soon as obj_PlayerMover jumps (instantaneously, if possible)
Illustrative image
drive.google.com/file/d/1yfQMKTkokXxfaw_reBbGD6cW8oyYmPP-/view
I managed to get it to work as the intended way when landing on VERTICAL platforms, but couldn't do it when landing on HORIZONTALS OR DIAGONALS
How I did it so far
I created an obj_PlayerDestinyFinder that has bullet behavior enabled and set it to spawn when pressing Space Bar (along with jumping with obj_PlayerMover) and, whenever it collides with any obj_Floor instance, set angle of obj_PlayerPointer based on an specific formula (see in file).
As I said, the formula works as intended when landing on Vertical platforms, but not when landing on Horizonals or Diagonals...
I created an instance variable on obj_Floor and created different conditions to set it to "Horizontal", "Vertical" and "Diagonal" based on the angle of each particular instance...but I don't know how to "read"/"return" this instance value.
What I'm aiming to try next, but don't know how to do it in Construct!
When thinking about this, I thought that something similar would be the solution to the way I'm tackling it:
- If obj_PlayerDestinyFinder collides with an instance of obj_Floor
- Check instance variable of the instance of obj_Floor which obj_PlayerDestinyFinder collided with.
- If it's "Vertical" > set angle using "Formula A"
- If it's "Horizontal" > set angle using "Formula B"
- If it's "Diagonal" > set angle using "Formula C"
PS
I've been trying to accomplish this during the last week, with no success. Got a little burned out, but I'm still up on my feet!