Jump to content

Fixing Bugs on a Simple Shooter Game


infinitim
 Share

Recommended Posts

Hi all... I'm programming a simple JS canvas game and I have a couple questions about two bugs I have noticed. I'll attach the game's code so you can play it and see visually what I am talking about.

The first bug, which you will definitely notice when you start moving around (use arrow keys), is that the player (green square) seems sort of fuzzy/compressed on the side that is on the direction they are travelling. This one I have absolutely no idea as to what is causing it, but it doesn't seem to happen on the enemies. If anyone has any ideas about what's causing that or how to fix it that I would love to know. 

The second one happens when you shoot (use WASD keys) while moving. The rocket (blue square - my graphics are stunning)  seems to make a curved triangle sort of shape (sort of hard to describe), like it is accounting for the movement of the player and when it exits the canvas it seems to be fully corrected as far as I can tell. I want it to instead shoot straight while my player continues onward in the direction they are going.    

If anyone can tell me what is causing these bugs and/or how to fix it that would be great! Thanks.

The files:

run.html

game.js

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...