Game Link
What I expect to happen: When you click on the game, the title show disappear and kirby should appear with the enemies and fruits looping.
What actually happens: Kirby disappears once you click the mouse.
What I’ve tried: I’ve used the debug block to see where the sprite is. I’ve set a watcher on the sprite and it says it’s visible even when it isn’t. I tried looking for where the .visible block is to make sure it stays visible. I tried moving the sprite further down in the code, but it still doesn’t appear.
your velocity is throwing kirby off the canvas seems that either the gravity velocity is too high or the collision box is not enough to keep kirby in bounds
I would fix it if i had more time but hopefully this should be enough for you to go off of
Thanks. I used a watcher on kirby’s y location and saw how it was appearing below the screen. I removed the gravity, but it was still appearing lower. I eventually redid how it jumped and that fixed things.
However, now it’s freezing after a few second and I’m not sure why. I’m not getting any errors, so I am not sure where to look to fix this problem.
Jenny
your while loops were causing the issue here i have tweaked them a bit but most new students new to programming should likely shy away from this as there isnt really any tell tale factors of the issue
what i assume is happening is that 2 types of food or enemy will repeatedly intersect forcing a new number to be generated and it continuing to do that will halt the system until it finds a balance when its not intersecting now imagine both respawns or even multiple respawn codes running at the same time you have maybe 5 -8 running at a given time causing it to crash Game Lab - Code.org i had changed a few other things i have not had this crash on me yet, if you want to be on the safe side i would possibly mess around with the displace function that way you will get the benefit of no overlap while not locking up the programs process and then completely remove the while loops from your respawn code