Debugging Impact Game

[Posts in the debugging category need to have the following pieces of information included in order to help other teachers or our moderator team best help you. Feel free to delete everything in brackets before posting your request for debugging help.]

*Link to the project or level: - Game Lab

What I expect to happen: I want the food to appear at steady intervals and the lysol to kill the viruses and the food to give the person points on contact and the viruses to take away points on contact

What actually happens: I can not get the food to come at steady intervals or control the lysol sprites.

What I’ve tried: I have tried moving the “for loop” re phrasing it and trying to simplify the instructions of the lysol.

Hi @klandman,

This is going to be a great game. It is beyond the scope of CS Discoveries but can’t wait to see it once it is up and running. Many concepts are beyond my understanding but if this was my student, I would start by asking questions based on what I do know. Here are my initial questions and perhaps others will also chime in…

You have a variable named 1. Can you consider renaming and following naming conventions? Not sure it is causing an error but not sure how I would check the value of the variable in a watcher or the console.

You are creating/declaring many variables inside the draw loop. Your first error is that the variable is undefined. Can you create the variable outside the draw loop and then update the necessary properties inside the draw loop?

I don’t believe you can name animations as numbers and then use random number to assign animations. I believe they are different data types. Can you create an array or use groups differently such as in the 2nd example in the documentation?

These are just a beginning set of questions and hopefully others can assist more.