ELEC2645 (2018/19) / Mbed 2 deprecated el17aio

Dependencies:   mbed

RosenEngine/RosenEngine.h

Committer:
ikenna1
Date:
2019-05-03
Revision:
35:3341f2bd0408
Parent:
34:6d0786582d81
Child:
36:c25417f0d150

File content as of revision 35:3341f2bd0408:

#ifndef ROSENENGINE_H
#define ROSENENGINE_H

#include "mbed.h"
#include "N5110.h"
#include "Gamepad.h"
#include "Ship.h"
#include "Weapons.h"
#include "Menu.h"
#include "Enemy.h"
#include "Health.h"

class RosenEngine
{

public:
   RosenEngine();
    ~RosenEngine();
    
    void init(int ship_width,int ship_height,int ship_speed,int ship_xpos,int ship_ypos);
    void reset();
    void read_input(Gamepad &pad);
    void update(Gamepad &pad);
    void draw(N5110 &lcd, Gamepad &pad);
    void get_pos();
    void title(N5110 &lcd);
    int get_ycursor();
    int get_shipno();
    void ship_select(N5110 &lcd);

    
    int ship_xpos; 
    int ship_ypos; 
    int ship_width;
    int ship_height;
    //*** note: add ship width and ship heirgth in place of 6 and 9 to generalize arrays after they are finished
    
private:
    
    void score(int points);
    bool check_collision(int xpos1, int ypos1,int width1,int height1,int xpos2, int ypos2,int width2,int height2);
    bool check_collision1(int xpos1,int width1,int xpos2,int width2);
    void test();
    void seeker_ship_collision(Gamepad &pad);
    void shooter_ship_collision(Gamepad &pad);
    void shooterw_ship_collision(Gamepad &pad);
    void kestrelw_seeker_collision(Gamepad &pad);
    void imperionw_seeker_collision(Gamepad &pad);
    void kestrelw_shooter_collision(Gamepad &pad);
    void imperionw_shooter_collision(Gamepad &pad);
    
    // Variables
    Ship _ship;
    Weapons _weapons;
    Menu _menu;
    Enemy _enemy;
    Health _health;
    float _xjoystick;
    float _yjoystick;
    Direction _d;
    int _ycursor;
    int _shipno;
    int _score;
    int _shno;
    Vector2D _shooter1_pos;
    Vector2D _shooter2_pos;
    Vector2D _shooter3_pos;
    Vector2D _coloc;
    

};
/************STUFF TO FIX******************************
**** add sound effects for sjield braking
**** add passive shield regeneration
**** work on score increase
**** add title screen with name
**** make it so back asks you if you are sure and ststes that you will lose all progress
**** think of level system
**** orion should send out pulses that stun enemy ships and absorb thier shields(use draw line)
**** scale shields properly
**** fix the border issue(i.e the ships clip through healthbar)
**** make it so enemy ship spawning is random use srand
**** add in options for lcd brightness and contrast
**** add in cheats
**** 
*/
#endif
/*
bool RosenEngine::seeker_ship_collision()
{
    // Vector2D ship_pos = _ship.get_pos();
    Vector2D seeker_pos = _enemy.get_seekerpos();
    int seeker_xpos = seeker_pos.x, seeker_ypos = seeker_pos.y;
    bool sscol;
    sscol = check_collision(seeker_xpos,seeker_ypos,9,6,ship_xpos,ship_ypos,9,6);
    return sscol;
   
}
*/