Jamie Slowgrove - MGP Assignment 2 - JAM
 All Classes Namespaces Files Functions Variables Macros
Player.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <iostream>
4 #include "JAM/Entity.h"
5 #include "JAM/ArrowPad.h"
6 
11 class Player : public JAM_Entity
12 {
13 private:
17  bool up;
19  bool down;
21  bool left;
23  bool right;
25  float screenWidth;
27  float screenHeight;
30 
35  void windowsInput(SDL_Event& incomingEvent);
36 
41  void androidInput(SDL_Event& incomingEvent);
42 
43 public:
56  Player(JAM_Texture* sprite, float x, float y, float width, float height, JAM_Vec2 velocity,
57  float screenWidth, float screenHeight, JAM_ArrowPad* arrowPad);
58 
62  ~Player();
63 
68  void input(SDL_Event incomingEvent);
69 
74  void update(float dt);
75 };
void androidInput(SDL_Event &incomingEvent)
Definition: Player.cpp:118
bool left
Definition: Player.h:21
JAM_Vec2 velocity
Definition: Player.h:15
float screenHeight
Definition: Player.h:27
JAM_Texture * sprite
Definition: Entity.h:14
Creates a Texture for use with a renderer. Creates a Texture from an image file, this can then be use...
Definition: Texture.h:13
float screenWidth
Definition: Player.h:25
void input(SDL_Event incomingEvent)
Definition: Player.cpp:31
bool up
Definition: Player.h:17
Player(JAM_Texture *sprite, float x, float y, float width, float height, JAM_Vec2 velocity, float screenWidth, float screenHeight, JAM_ArrowPad *arrowPad)
Definition: Player.cpp:6
Creates an ArrowPad object.
Definition: ArrowPad.h:12
bool right
Definition: Player.h:23
void windowsInput(SDL_Event &incomingEvent)
Definition: Player.cpp:49
~Player()
Definition: Player.cpp:24
bool down
Definition: Player.h:19
Creates a Player object that inherits Entity.
Definition: Player.h:11
void update(float dt)
Definition: Player.cpp:130
JAM_ArrowPad * arrowPad
Definition: Player.h:29
Creates an Entity object.
Definition: Entity.h:10
Creates an Vec2 structure with functions. Creates an Vec2 structure with overloaded operators to crea...
Definition: Vec2.h:9