The problems I’m having is that at the beginning of the game when you first open it, sometimes the character sprite dies for seemingly no reason multiple times before it works again, I have no idea what code causes this or how to fix it.
The other issue is that I’m using functions to make seperate levels, and when you get to level 2 (by getting to 3 points, just live for a few seconds) I’ve copied the same code/if statement that makes the enemies spawn and go across the screen in the first level, but now is only spawning 1 sprite or not spawning at all.
How do I fix these problems?
Hello @F4lseReal1ty ,
I have found your problem. There is a building hitting the player, but you can’t see it because it was made before the background was put in place. So the building is behind the wallpaper sprite. You can set the wallpaper to a background to be able to see the sprite, but I assume you avoided that because you didn’t need to take the time making it and for that you can use a special tool in the sprite editor. If you are in the editor and see a square with four squares in it, you can click that and hold left click as you select your image. Once you select the image hit ctrl + C to copy it, and then go into the background block and hit ctrl + V to paste it onto the editor from there you can drag the white box in the corner to expand/scale it. I have some code of that but only for the first wallpaper.
Now you can see what’s hitting the sprite. My next ideas would be to find a way to make sure the buildings wont spawn until everything is set up.
It’s nice to see a new MakeCoder and if you have any more questions feel free to @-Message me or anyone else.
2 Likes
Hey could you please help me with the 2nd level of my game? None of the spriteswill spawn no matter what I try to do, even when copy pasting the first level code to the 2nd level it still wont work, if you could help me with this thatd be very appreciated thank you
Heres the updated code
1 Like
The problem is that the code that checks if the score equals 3 checks often enough to change the level twice, you can fix this by setting the level to 2 instead
Hey again,
I’m unsure exactly what the problem was. However, I did fix it. The way you were counting the score messed up the variable that checks what level it is. There is actually a block for always checking the score and I replaced your original code for that.
Nice game and if you need my assistance again feel free to @-mention me or anyone else.
Good luck!
2 Likes