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.
CheckCollision Class Reference
CheckCollision class. More...
#include <CheckCollision.h>
Inherits Position.
Inherited by Alien, and Spaceship.
Public Member Functions | |
| bool | check_collision (Weapons bullet) |
| Checks if bullet collides with a sprite. | |
| Vector2D | get_pos () |
| Gets the xy position of the sprite. | |
Protected Attributes | |
| int | sprite_x_length |
| Length of sprite in x direction. | |
| int | sprite_y_length |
| Length of sprite in y direction. | |
| int | position_x_ |
| X position on lcd. | |
| int | position_y_ |
| Y position on lcd. | |
| bool | direction_ |
| Movement direction. | |
Detailed Description
CheckCollision class.
Check Collision perant class
- Date:
- May 2020
Definition at line 14 of file CheckCollision.h.
Member Function Documentation
| bool check_collision | ( | Weapons | bullet ) |
Checks if bullet collides with a sprite.
- Parameters:
-
bullet Weapons object
Definition at line 3 of file CheckCollision.cpp.
| Vector2D get_pos | ( | ) | [inherited] |
Gets the xy position of the sprite.
- Returns:
- position_x_
- position_x_
Definition at line 3 of file Position.cpp.
Field Documentation
bool direction_ [protected, inherited] |
int position_x_ [protected, inherited] |
X position on lcd.
Definition at line 27 of file Position.h.
int position_y_ [protected, inherited] |
Y position on lcd.
Definition at line 30 of file Position.h.
int sprite_x_length [protected] |
Length of sprite in x direction.
Definition at line 27 of file CheckCollision.h.
int sprite_y_length [protected] |
Length of sprite in y direction.
Definition at line 30 of file CheckCollision.h.
Generated on Fri Aug 5 2022 06:55:08 by
1.7.2