Looking for Help: Animating Platform Movement with 5 Pictures

Hello everyone!

I’m excited to ask my first question in this amazing community and really hope you can help me out.

I’ve only been working with GDevelop for a few weeks, so I’m still fairly new to it, especially when it comes to JavaScript. I’m currently working on a cute endless runner, similar to the Chrome Dino Game.

However, I encountered an issue during my first Android export: image files in Android apps cannot exceed 2000x2000 pixels. It’s a shame that there’s no notification about this when importing assets if you’ve already selected Mobile Game in advance.

My running platform, however, is over 9000 pixels wide. So, I split the file into five separate images. But now, I’m facing the next problem: I can’t get the platforms to move in sync. Only the first image, “Gras,” moves correctly, while the others (Gras2 to Gras5) are ignored.

No matter how I adjust the formulas, only Gras1 moves and repeats endlessly. To get to the bottom of this, I started looking into JavaScript. There, I managed to get all the clouds and platforms to move uniformly. However, when exporting, the transitions between the individual images are visible, and I haven’t been able to apply the movement translation to the obstacles and collectibles. These are controlled in GDevelop using TimeDelta(), and I haven’t been able to translate this into the script correctly – in short, the obstacles and collectibles don’t sync with the platform.

Now I want to try it again directly in GDevelop. But as mentioned, the formulas don’t seem to resolve correctly, and only the first Grass image moves. When I activate Gras2 and deactivate the others, Gras2 moves as intended. However, as soon as I activate all the grass objects, only the Gras object moves, and nothing else.

My attempts:

ezgif-1-9b8f99cd9a

https://i.imgur.com/vk741fK.png
https://i.imgur.com/2ZgBTEW.png

Do you have any idea where my mistake might be?

Thank you very much in advance for your support!

Pelle

More Screenshots…

https://i.imgur.com/YQ0MsJv.png
https://i.imgur.com/1W0jp0B.png

There is a built in endless runner that might help

Thank you for your help, but unfortunately, that doesn’t work. The build in endless runner platform is made up of just a single tile.

I also tried grouping all the grass objects together and applying the “Change X Offset” formula to the group. Unfortunately, I got the same result.

My god i just realized what you are trying to do
I was sure when i saw it 1st time you just use same action 5 times
Now i see its for 5 different objects
Your mistake is you move these objects while at the same time roll them like video tape
And that will never work since they can’t fit each other in every point they have

So your option is making one image out of it and don’t change its position but only change offset while it being tiled sprite

OR add each object as sprite object
And you only change their position
BUT you would need to delete each object when it gets off screen on one side
And then create it off screen on other side
This way you would achieve what you want

BTW you do not need your image to be 9000 pixels wide like come on
Scale it down and look to how much you can go
I would try even 9000 / 10
BTW i think limit for most mobile devices is around 1k so most if not all phones would not even display your image
IF you were to make your game playable on mobile devices

Don’t. There’s no ned to use javascript. What you want to achieve can easily be done using GDevelop events.


Put the grass, platforms and collectables on the same layer.

If you can screen snip the events you have currently to move the grass, then someone can help to sort out your issue.

In the meantime, here’s a short demo of one way you could implement it:

My scene (the platforms are in a object group named platform_group). Clouds and platforms are on the layer “Scrolling”, and the background is on the base layer:

My events:

What I’m actually doing:
scrolling


The result:
scrolling


Hey everyone, thank you so much! This has been incredibly helpful. Now it’s working. Thank you again! I had been working on it for quite a while and even started learning JavaScript to try and solve it that way

With MrMan’s description, it works perfectly <3

1 Like