Need help understanding why (and how) this works

Hello all! I’ve recently switched as a beginner gamedev to GDevelop after some frustrations with pure coding in general. Visual scripting seems more approachable so here is where I’m at after switching.

I’m currently working on my first project within the engine. I’ve been using Gdev for less than a week now and I hit a wall trying to animate waves for my game. I must’ve spent two days trying to make it work and I accidentally figured it out today, but I don’t quite understand why it works.

I’m making an ASCII fishing game. I’m using “~~~~” as a platform under the character sprite - It is the ocean, and each “~” is a singular WavePlatform sprite/tile, as I’ve named it.

My biggest issue was that I could not get the waves to go up and down and then loop. I tried using While but it would freeze the preview entirely, I tried timers, repeats and everything else - could not get it to loop.

Earlier today I implemented Tweens and separated them for up and down idle motions. It now works as intended, but I am not exactly sure why this loops. Here’s what I have in the events tab:

When I did it I was kind of trying random things together, so I’m a bit lost on how exactly this works and why it loops.

If I remove the “trigger once” condition, it doesn’t work, and if I disable my "Tween ‘WaveDown’ " event under it, it also doesn’t work. I could not figure out a way to use less actions or events. Maybe this is due to my lack of logical knowledge when it comes to programming - I could not get very far with python at all.

If anyone could provide a deeper insight of why all of this works, a breakdown would be extremely appreciated! Thank you. Sorry if it’s kind of a weird question. I’m trying to learn from it.

1st of all
Tweens should NOT run each frame
What it means is like go to youtube open any music video
Play it
And now hold 2 on your keyboard
THAT is what happens when tweens run each frame

Tweening something only ONCE is like you would press 2 and release it immediately
So as you would expect it to work

Trigger once is like CHECK if condition is true but kick in this event only once UNTIL condition 1st become false then true again

So i if you would jump then land on floor you would spam it each time you were on floor

2nd sub event i assume tween finished can happen only once
Like you read THIS
After you read it you finished reading it only once
You its not like you are finishing constantly
Where only thing that constantly now happens is that you are not reading it from now on
But you finished it only once

That is how your events work

HOWEVER
This is for floating object
But i guess should be way easier for you to understand

That does make sense. I was glad that I had finally figured out how to loop it but I didn’t quite understand why that mess worked out, and it didn’t seem like it should be working.

Not knowing the fundamentals has made this a lot harder for me, I think.

I’ll go back to the drawing board with the example you gave in mind and give it some more thought. Thank you.

1 Like

Hi Lycan!

You did not choice the easybility for beginning with GDevlop, creating animated waves!
But perhaps you have some experience in other game engines or in informatic.

Good luck for your project.

Xierra

1 Like