My Score not adding according to time and also Levels returns back to the base scene with no enemies to kill

Please, that is my Base scene (Event) Tab; I have two issues with it;
1: My score is not adding according to time
2: The game as three level and when I clicked to start the first level it returned back to the base scene with no enemies to shoot. What should I do? It’s a space shooter game

Use snipping tool in desktop for screenshots

1 Like

You can’t see the picture clearly?

Yeah, something like that. I also can’t rotate it from browser and see.

Okay I will switch to my pc then I was using phone before

1 Like

You are adding Round(TimeDelta() + 50). TimeDelta will be way less than 0.05, and 0.05 rounded is 0, so you will only be adding 50 every frame. Did you mean Round(TimeDelta() * 50), perchance?

You’re loading from external layout named level1 at the start of the scene. Is level1 actually an external layout, or a scene? If it is a scene, use the Change Scene action. If it is an external layout, make sure it’s based on the Base Scene.

Actually the Time delta thing was on * before i was just trying to check around if changing the sign would let the counting begin.

This is how the event tab was like normally before i started altering

If LevelSelection is 2, then you realise “Level1” + GlobalVariableString(LevelSelection) will try loading “Level12”? Is this your intention?

As for your score issue, you are setting Score (with a capital ‘S’), while displaying score (with a lower case ‘s’). GDevelop is case sensitive.

Does that means I should change all the Uppercase “S” to lower case?

My intention is not for it to load level 12 my intention for it is load level 1 and when the object get to the finish level it should return back to the Basescene and unlock level two. Are my commands for that wrong?

Thanks man, I got that my score is now increasing with time. Thanks once again

Yes. I suggest you set LevelSelection = 1 (say at the beginning of BaseScene), and just use the command “Level” + GlobalVariableString(LevelSelection).

And to confirm, your levels are External Layouts, and not Scenes? They are different. If they are external layouts, you’ll need to clear the current layout objects in the scene before loading the next layout. Just loading the external layout doesn’t get rid of the objects of the previously loaded layout.

That is the picture. Is it external or scene?

Its an external layout

Yes, external. So you should clear out the objects before you load the next layout. All the layouts do is describe where the objects are placed in the current scene on display. It won’t wipe existing objects.

I have change it to “Level” instead of “Level1” and the object are not showing at still. And also how do i clear out the objects

A layout isn’t an actual scene. They will not act as an actual scene. You need to add the content of external scene into your actual scene in a position and the objects will be placed in relative to the fixed position where you added the External Layout

Assuming you have placed objects in the external layout, make sure the scene camera is at the same position as where the objects are in the external layout.

For example, if you have objects that lie within the square 1000x1000 in the external layout, but your scene camera is at x=5000, y=5000, then the objects won’t show, because the camera is way outside the area where those objects are placed.