Closed kellylarrea closed 3 years ago
What do you see in console when you console.logging allFoods[i]?
nothing is showing up when I console log it
Would you mind showing me your array with allFoods?
Food {x: 0.5930871299184475, y: 0.6071007373572399, color: '#C36A2D', width: 20, height: 20, …}
I forgot to invoke it in my game loop. This is the console log I see.
let allFoods = [watermelon, spinach, potatoChip, twinkie] this is the food array
This is resolved! Kelly will update :)
Was able to spawn my foods instead of <5 it was changed to < allFoods.length
What's the problem you're trying to solve?
trying to spawn my food items randomly.
Post any code you think might be relevant (one fenced block per file)
If you see an error message, post it here. If you don't, what unexpected behavior are you seeing?
no error messages. the items are not spawning just moving in different directions
What is your best guess as to the source of the problem?
I probably don't have the logic correct on this.
What things have you already tried to solve the problem?
I tried changing the code around.