The Daily Static
  The Daily Static
UF Archives
Register
UF Membership
Ad Free Site
Postcards
Community

Geekfinder
UFie Gear
Advertise on UF

Forum Rules
& FAQ


Username

Password


Create a New Account

 
 

Back to UserFriendly Strip Comments Index

C++, Degrees and Space Mines by really-joel2007-08-08 07:24:21
  High school math by Orky 2007-08-08 07:32:17

Sine and cosine are high school math, you should know this stuff (do they even let people on the internet without knowing it?)

Maybe you should store the velocity as a vector instead of an angle. That way, it takes less calculating to move the object, and you can give them different speeds.

class Bullet(float x, float y, float dx, float dy)

where dx^2 + dy^2 = speed^2 (Pythagoras)

[ Reply ]
    Re by really-joel2007-08-08 07:41:24
    Orky, that first line was unnecessary. (n/t) by kelli2172007-08-08 07:53:21
      Agreed... by jdelphiki2007-08-08 09:26:47
      But it sounded funny! by Orky2007-08-09 07:24:13
    "An angle", combined with magnitude, is a vector. by Phoon2007-08-08 09:25:49

 

[Todays Cartoon Discussion] [News Index]

Come get yer ARS (Account Registration System) Source Code here!
All images, characters, content and text are copyrighted and trademarks of J.D. Frazer except where other ownership applies. Don't do bad things, we have lawyers.
UserFriendly.Org and its operators are not liable for comments or content posted by its visitors, and will cheerfully assist the lawful authorities in hunting down script-kiddies, spammers and other net scum. And if you're really bad, we'll call your mom. (We're not kidding, we've done it before.)