Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: 25LCxxx_SPI CommonTypes Gameduino mbed
BrainBulletObject.cpp@7:e72691603fd3, 2013-06-08 (annotated)
- Committer:
- RichardE
- Date:
- Sat Jun 08 16:44:54 2013 +0000
- Revision:
- 7:e72691603fd3
Now have grunts wandering around on level 1. They follow the player but since no collision detection logic yet nobody ever gets killed.
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| RichardE | 7:e72691603fd3 | 1 | /* |
| RichardE | 7:e72691603fd3 | 2 | * SOURCE FILE : BrainBulletObject.cpp |
| RichardE | 7:e72691603fd3 | 3 | * |
| RichardE | 7:e72691603fd3 | 4 | * Definition of class BrainBulletObject. |
| RichardE | 7:e72691603fd3 | 5 | * |
| RichardE | 7:e72691603fd3 | 6 | */ |
| RichardE | 7:e72691603fd3 | 7 | |
| RichardE | 7:e72691603fd3 | 8 | #include "BrainBulletObject.h" |
| RichardE | 7:e72691603fd3 | 9 | |
| RichardE | 7:e72691603fd3 | 10 | /***************/ |
| RichardE | 7:e72691603fd3 | 11 | /* CONSTRUCTOR */ |
| RichardE | 7:e72691603fd3 | 12 | /***************/ |
| RichardE | 7:e72691603fd3 | 13 | BrainBulletObject::BrainBulletObject() : |
| RichardE | 7:e72691603fd3 | 14 | HVelocity( 0 ), |
| RichardE | 7:e72691603fd3 | 15 | VVelocity( 0 ) |
| RichardE | 7:e72691603fd3 | 16 | { |
| RichardE | 7:e72691603fd3 | 17 | DeleteWhenRestricted = true; |
| RichardE | 7:e72691603fd3 | 18 | RetainOnLevelRestart = false; |
| RichardE | 7:e72691603fd3 | 19 | PixelWidth = 4; |
| RichardE | 7:e72691603fd3 | 20 | PixelHeight = 4; |
| RichardE | 7:e72691603fd3 | 21 | } |
| RichardE | 7:e72691603fd3 | 22 | |
| RichardE | 7:e72691603fd3 | 23 | /************************/ |
| RichardE | 7:e72691603fd3 | 24 | /* DRAW THE GAME OBJECT */ |
| RichardE | 7:e72691603fd3 | 25 | /************************/ |
| RichardE | 7:e72691603fd3 | 26 | // Note if Visible is false this should not draw anything |
| RichardE | 7:e72691603fd3 | 27 | // and/or hide the visible object. |
| RichardE | 7:e72691603fd3 | 28 | void BrainBulletObject::Draw( Gameduino *gd ) { |
| RichardE | 7:e72691603fd3 | 29 | gd->sprite( SpriteNumber, ToPixel( Xco ), ToPixel( Yco ), BrainBulletImage, 0, Gameduino::None, BadGuy ); |
| RichardE | 7:e72691603fd3 | 30 | } |
| RichardE | 7:e72691603fd3 | 31 | |
| RichardE | 7:e72691603fd3 | 32 | /************************/ |
| RichardE | 7:e72691603fd3 | 33 | /* MOVE THE GAME OBJECT */ |
| RichardE | 7:e72691603fd3 | 34 | /************************/ |
| RichardE | 7:e72691603fd3 | 35 | void BrainBulletObject::ProtectedMove( void ) { |
| RichardE | 7:e72691603fd3 | 36 | Xco += HVelocity; |
| RichardE | 7:e72691603fd3 | 37 | Yco += VVelocity; |
| RichardE | 7:e72691603fd3 | 38 | } |