Closed emilybarwinczak closed 3 years ago
What's going on here : ``` const $span = $(catsbrown); // $span.fadeOut(1000, function(){
it was a random function I tried to see if it would make one of the cats move...have been trying a lot of random things haha
I think you're using some jQuery there but we should just stick to vanilla JS
So what you're thinking through is making an array that holds a set of movements? And then a function that loops through that array and is called later to move the cats?
yes that's my tentative plan right now, just am not currently able to start that process on account of my brain stopped working :) and also not even sure if that's the best (or even a good) way to do it, ahh woe is me!
worked with Tom and figured out how to get them to move randomly, now onto my next issue!
in my gameLoop after rendering each cat:
catsbrown.render()
catsorange.render()
catsblack.render()
catsbrown.x += 4
catsorange.x -= 4
catsblack.y += 4
What's the problem you're trying to solve?
I have my player and a function that ends the game in a win when you reach the house. I've created three new crawlers (cats of varying color) but am just dead stuck on figuring out how to get them to move around the board on their own
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. not seeing any unexpected behavior either
What is your best guess as to the source of the problem?
was thinking about making an array with movements inside and somehow have one selected at random and move that one of (or all) the objects accordingly but I am sturgggggggglin
What things have you already tried to solve the problem?
a lot of random code to get one specific item to move but then it disappears from the game board all together