Contains every functions declaration for play.c.
More...
Go to the source code of this file.
|
void | playGame (SDL_Surface *w) |
|
int | shoot (SDL_Surface *w, LAYOUT *l, float a, float sp) |
|
void | loadFont (LAYOUT_TEXT *t, SUCCESS_TEXT *s) |
|
void | setParameters (LAYOUT_TEXT *t, float a, float sp) |
|
void | loadLayout (LAYOUT *l) |
|
void | reloadLayout (LAYOUT *l) |
|
void | drawLayout (SDL_Surface *w, LAYOUT *l) |
|
void | drawLine (LAYOUT *l, float a) |
|
void | drawText (SDL_Surface *w, LAYOUT_TEXT *t) |
|
void | drawResult (SDL_Surface *w, SUCCESS_TEXT *s, int result) |
|
void | cleanUp (LAYOUT *l, LAYOUT_TEXT *t, SUCCESS_TEXT *s) |
|
Contains every functions declaration for play.c.
- Author
- Maxime LEFEBVRE
- Date
- 23/02/2018
- Version
- 1.0
Definition in file play.h.
◆ cleanUp()
Free the allocated memory for every game related surfaces.
- Parameters
-
l | Reference to the main general layout |
t | Reference angle and speed texts |
s | Reference to the results text |
Definition at line 300 of file play.c.
◆ drawLayout()
void drawLayout |
( |
SDL_Surface * |
w, |
|
|
LAYOUT * |
l |
|
) |
| |
Draw the layout on the main window for each shot.
- Parameters
-
w | Reference to the main window |
l | Reference to the general layout |
Definition at line 242 of file play.c.
◆ drawLine()
void drawLine |
( |
LAYOUT * |
l, |
|
|
float |
a |
|
) |
| |
Given an angle and a speed, define and draw the line that helps the player. Used functions :
- Parameters
-
l | Reference to the general layout |
a | Angle value set by the player, pre-shot |
Definition at line 253 of file play.c.
◆ drawResult()
void drawResult |
( |
SDL_Surface * |
w, |
|
|
SUCCESS_TEXT * |
s, |
|
|
int |
result |
|
) |
| |
Draw the the result on the main window after each shot.
- Parameters
-
w | Reference to the main window |
s | Reference to the results text |
result | Control variable, testing if the shot is a fail or not |
Definition at line 276 of file play.c.
◆ drawText()
Draw the angle and speed texts on the main window.
- Parameters
-
w | Reference to the main window |
t | Reference angle and speed texts |
Definition at line 268 of file play.c.
◆ loadFont()
Load all the fonts needed for in-game display.
- Parameters
-
t | Reference to the angle and speed texts |
s | Reference to the results text |
Definition at line 165 of file play.c.
◆ loadLayout()
Load the game layout with background, ball, line, flag.
- Parameters
-
l | Reference to the general layout |
Definition at line 199 of file play.c.
◆ playGame()
void playGame |
( |
SDL_Surface * |
w | ) |
|
Load the new game window so that the player can play.
- Parameters
-
w | Reference to the main window |
Definition at line 23 of file play.c.
◆ reloadLayout()
void reloadLayout |
( |
LAYOUT * |
l | ) |
|
Reload the layout if the previous shot was missed.
- Parameters
-
l | Reference to the general layout |
Definition at line 234 of file play.c.
◆ setParameters()
void setParameters |
( |
LAYOUT_TEXT * |
t, |
|
|
float |
a, |
|
|
float |
sp |
|
) |
| |
Set the angle and speed values for display.
- Parameters
-
t | Reference angle and speed texts |
a | Angle value set by the player, pre-shot |
sp | Speed value set by the player, pre-shot |
Definition at line 191 of file play.c.
◆ shoot()
int shoot |
( |
SDL_Surface * |
w, |
|
|
LAYOUT * |
l, |
|
|
float |
a, |
|
|
float |
sp |
|
) |
| |
Determine the ball position from the start point until in touches the floor. Return 1 if the ball landed on the flag, 0 otherwise. Used function :
- Parameters
-
w | Reference to the main window |
l | Reference to the general layout |
a | Angle value for the current shot |
sp | Speed value for the current shot |
Definition at line 97 of file play.c.