Anywhere Games 2022-06-21 15:29
I haven’t yet implemented it yet but I, was thinking to use a Dim variables for the direction it’s facing and the length of the hookshot itself, this is for a side-scroller of course. Then a sub program for the execution of it? What are your thoughts fellow Lowresians?
P.S. I really only understand and know basic math.
McPepic 2022-06-21 17:09
Do you want it to only fire horizontally, or vertically as well?
Anywhere Games 2022-06-21 17:37
Anywhere Games 2022-06-21 17:40
One at a time thou
McPepic 2022-06-21 18:17
I usually store a single value that stores the direction. When you press the directional inputs, you can update the direction for the hookshot. I’d assume you’d also freeze the player to avoid messing anything up. You can store a max distance, allowing you to set the final position of the hook after it’s launched. You can then represent it as a sprite that compares its current position to the target position. Then, each frame, you move it one pixel towards the target. When it hits its destination, you set the player to the new target and disable it when it reaches the player.
This is a pretty general feature and it’s up to you how you want to implement it. This should help you get started though.