New sequel quere

hello again, I’m making a sequel to a game I posted a little bit ago, and its a shooter, yay(there is no blood or anything bad, don’t worry its all weird sci Fi)! anyway, my quere is that after the starting cutscene with our main character, the game crashes. I am having the problem it it not reading fields. I looked at it and found nothing being made before it was mentioned so I do not get the problem. could someone help? https://arcade.makecode.com/S36139-87517-90397-95040

1 Like

hello, I worked out a bunch of bugs but now my game just freezes when you shoot the gun, can anyone help?

1 Like

@top_hat_lord generally when games freeze, a while loop somewhere is the culprit!

taking a look at your code here:

this while loop will never exit because cutscene isn’t being set to false inside it. your game freezes because this while loop never allows any other code to run.

looking at this code, i think you’re trying to make it so that the gun fires continuously while you hold down A. if that’s the case, i think something like this might work better for you:

and you might also want to add a pause block in there so that it doesn’t fire at max speed!

2 Likes

another thing i noticed, in your “on life zero” event, you’re pausing while a melody plays:

image

that will also cause the game to freeze temporarily. the easiest way to fix this one is to wrap the music playing + game over inside a “separately do” block from the timers extension like so:

then you can also run some sort of death animation if you want

1 Like

thanks! this works for the game over screen thing, but the pew pew gun with the cutscene block is suppose to only let you shoot when the cutscene is not going on. it does work, but It freezes if you do shoot after the cutscene, it freezes as mentioned. could you help me make that part of this…well work?

realized what I said, sorry! thanks for helping!