Save files for the user...

There’s not a lot of documentation about this, and I couldn’t find a lot of help already in the forums…

Is there a way that I can give the user a save file option (like saving in most video games)? I think I read something here about GDevelop games automatically saving, but I don’t quite understand it. Even so, I’d like there to be an option for the user to save by clicking on a “save” button. I’m thinking primarily for Windows/Mac/Linux native, and Android via HTML5.

Another question…

So by default, the “camera” focuses on the screen window, and I have to create an event for the camera to focus on the player sprite? If I’m making a side scrolling platformer, I can make the background and the scene however wide I want? Is that the only way I can make a platformer-like game sidescrolling? Is there an easy way to trigger a new “scene” when the player sprite reaches the furthest most right edge of the background? How do I set the background to be a certain width in pixels? (Different from the screen window, of course.)

You can use the storage actions to write any info such as the X,Y position of player, health, life, score, levels completed…etc in to a file in native games and in to web storage in HTML5/Android games.

Take a look at the “Basic level editor” example comes with GDevelop to see how it works.

GDevelop got a feature called “scene stack”. When you change the scene, you can choose to pause the current scene before go to the next, so when you go back to the previously paused scene you can continue where you left off. But you can’t use this feature to create a “save” option, it pause the scene only when you change the scene and I’m not 100% sure if it actually saves anything and works even after the player quit the game. I have never used this feature really, I’m always using the storage actions to create a save-load system.

Sort of, the camera does not focusing on anything by default. If you want it to focus on something and may follow it movement, yes you need to use an event to make the camera focus on an object and follow. You can find this option in the “layers and cameras” section

Yes, the scene size in GDevelop is infinite so you can go as high and as wide as you want. To see more or less part of the scene, you can change the size and zoom of the camera and you can also change the render zone of the camera to make sure things not get rendered if it outside the camera and not visible.

You can make the player character move and set the camera to follow the movement of the player, you can also make everything move except the player and camera. You can also move the camera on X,Y axis by increasing or decreasing it X,Y position and you can also make the camera to follow an invisible object in case it helps in any ways.

You can change the scene in any situation and at any point in your game. If you want to change the scene when the player reaches the end, you can simply check collision between the player and an object at the end of the scene. When the player is in collision with that object, you can change the scene. The object can be even invisible. Alternatively, you can check the position of the player in global space, if it X position greater then let say > 3000px, you can change the scene, but I would prefer to check collision with an object at the end of the scene.

When you place the object in to the scene, you can simply drag it and scale it, if you need exact width and height, you can go to the object properties by using right mouse click on an object in your scene and choose properties. In the properties, you can choose custom size and enter the width and height you need. During game, the only thing you can do is scale it using a % system, like the original size is 1 which means 100%, if you set the scale to be 0.1 that is going to be the 10% of it original size.

The size of the screen and camera doesn’t effect the scene. As I have mentioned the size of the scene is infinite, you can place anything-anywhere regardless the position and size of the screen and camera. If you have a huge scene you can even zoom in and out in the editor to see it better and if you wish to see the size of your screen anywhere in the scene to make sure everything fit, you can enable the “Mask” option on the top and you can also enable the grid to help with positioning the objects.

It’s not a “save” feature. It just keeps a scene in memory (RAM) while another scene is running (and it allows to go back to it after).

Just a few things to add to ddabrahim’s detailed answer…

It’s the easiest way, but I suppose you could move the background past the player by changing its X position, rather than changing the player’s X position. You could also have a repeating background (like they used to do in old cartoons) where you have a short section of background that is moved back to the start once you reach the end of it.
See: Infinite moving background - #2 by Lizard-13

Since you can have multiple layers and each layer has its own camera, different bits of background can move at different speeds (see image below).


Here one camera follows the player, by being constantly repositioned to the Player.X() position, while the “background” layer camera lags behind a bit, giving a parallax effect. Much more comprehensive coverage of this is in the wiki.

By “background” do you mean a single very large sprite, or lots of small objects placed next to each other to build a background?