ZeldariaLvl 41
How do I put 2 different functions (I declared and defined them) in game lab and still get them to work? Every time I declare a function the function stops working T-T
How do I put 2 different functions (I declared and defined them) in game lab and still get them to work? Every time I declare a function the function stops working T-T
All functions except for draw()
, keyPressed()
, etc. must be used for them to work.
I will show u the code in a min
https://studio.code.org/projects/gamelab/0LirOCcMKkEdfUtZQMJfq4fHaOSqaVYmlpnRNol-DsY
my code just doesn't work anyways T-T
Your code isn't working because side_to_side()
and shoot()
only run once. Put them in draw()
like this:
function draw() {
side_to_side();
shoot();
}
thx it worked! But um how do I get the projectile to not show up until I press space?
In a different game lab project, I'm trying to get a sprite to move to the right until it reaches x coordinate 300 and then move in the opposite direction until it reaches x coordinate 100, then it moves in the opposite direction and the whole thing repeats itself over and over and stuff; how do I do that?
nvm I got it to work