Jeffery Hurley
/
Asteroids
Simple starter skeleton for asteroids video game.
Projectile.cpp@3:98aa3db6a48f, 2021-04-01 (annotated)
- Committer:
- jhurley31
- Date:
- Thu Apr 01 19:10:58 2021 +0000
- Revision:
- 3:98aa3db6a48f
Initial commit.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jhurley31 | 3:98aa3db6a48f | 1 | |
jhurley31 | 3:98aa3db6a48f | 2 | #include "Projectile.h" |
jhurley31 | 3:98aa3db6a48f | 3 | #include "graphic.h" |
jhurley31 | 3:98aa3db6a48f | 4 | |
jhurley31 | 3:98aa3db6a48f | 5 | // Replace the code below. You should pass in the direction of the command |
jhurley31 | 3:98aa3db6a48f | 6 | // ship and then have the projectile move along that direction |
jhurley31 | 3:98aa3db6a48f | 7 | void Projectile::reset() |
jhurley31 | 3:98aa3db6a48f | 8 | { |
jhurley31 | 3:98aa3db6a48f | 9 | |
jhurley31 | 3:98aa3db6a48f | 10 | int offset = 64; |
jhurley31 | 3:98aa3db6a48f | 11 | m_xPoints[0] = (0+offset); |
jhurley31 | 3:98aa3db6a48f | 12 | m_yPoints[0] = (5+offset); |
jhurley31 | 3:98aa3db6a48f | 13 | m_xPoints[1] = (0+offset); |
jhurley31 | 3:98aa3db6a48f | 14 | m_yPoints[1] = (8+offset); |
jhurley31 | 3:98aa3db6a48f | 15 | m_color = YELLW; |
jhurley31 | 3:98aa3db6a48f | 16 | m_numPoints = 2; |
jhurley31 | 3:98aa3db6a48f | 17 | m_bIsValid = true; |
jhurley31 | 3:98aa3db6a48f | 18 | } |