|
|
|
|
Reply From: |
Pomelo |
Sorry if this feels harsh but it is not the intent. You are not really asking anything. Try to be more specific and tackle one problem at a time. For example, what do you want “swimming” to be in your game? do you want the character to be able to move in all directions under the water?, do you want it to be still when no input is detected? do you need help with detecting when the player is in the water, in order to change some animations?
I could go on, but there is tons of stuff that could be done. So tell me, and I will try to help!
Lets try this
character walks across platform hits water swims to the other platform and then walks across it etc…
while in the water the character can look for and collect coins etc.
if the character dose not swim he sinks to the bottom (the character dies.)
if he is in the water for more than 5 min he dies
rodell2020 | 2022-06-12 22:05
Again sorry but too broad of a question. I am telling you this, so in the future you can get better awnsers. I dont know how much you know, and with what you need help, and of course i cant write you the whole code of everything you want as I envition it.
For example, collecting coins. What do you need help with there? Do you know about area detection, queue_free, saving score in a var?
Another thing, why is it important that the player starts and ends on a platform in your question. do you need help with the transition? like when the character is close to the border to have a climbing animation?
I would sugest that you just start by making the player to move in the water. You need to first know, when the player is ocupying water. To do this I would suggest having an Area2d on the water that sends a signal to the player when the player enteres and exits the area. Once that is done, write a var in the player called swimming that becomes true or false when recieving this signals. Then in the movement code, check if player is swimming, and do the correct changes. This includes a lower gravity value, and the ability to go upward.
Pomelo | 2022-06-12 23:06