WDI-SEA / game-project-issues

0 stars 0 forks source link

Can't get the plane to shoot #13

Closed Eddycodes27 closed 3 years ago

Eddycodes27 commented 3 years ago

What's the problem you're trying to solve?

I can render a bullet, but can't actually shoot.

Post any code you think might be relevant (one fenced block per file)



 case('Space'):
                // Shoot bullets
                bullet.x >= 0
                if (bullet.x + bullet.width >= game.width) {
                    bullet.x = game.width - player.width
                }
                break

```JS

### If you see an error message, post it here. If you don't, what unexpected behavior are you seeing?

No error, just can't figure out how to shoot.

### What is your best guess as to the source of the problem?

Maybe shooting requires more functions and elements than what i think.

### What things have you already tried to solve the problem?

Looking up other examples.
Eddycodes27 commented 3 years ago

Got my ship to shoot...lasers which are cool, but now I can't get the lasers to stick to the ship when I move the ship. Might be a frame/loop thing.

Eddycodes27 commented 3 years ago

Sticking to lasers, made suer performance is ok regarding lag by increasing and decreasing the value of the gameInterval.