I've decided to try to create a small (very) game in Javascript + HTML, using the Canvas element. So far, its gone pretty well, but recently I started on bullets. This also has gone well. I've decided to try to implement a bullet-goto-mouse type thing. I know this uses trigonometry, but, as I havn't had that class, and won't for a few more years, I went to Google. This got me a few more steps, and now I have a partially working system. There are a few problems:

  • It doesn't want to actually go to the right part of the Canvas. It will go on the right angle, but in a diffrent direction.
  • Its not always right

I've attached the code to this post (the zip file).

Thanks,
Jack

Recommended Answers

All 2 Replies

jackmaverick1, it would be easier if you set up a working fiddle rather than attaching the code :

http://jsfiddle.net/

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.