Steven Mahasin / Mbed 2 deprecated DreamDungeon

Dependencies:   mbed MotionSensor

Entity/Bullets/Bullets.cpp

Committer:
el17sm
Date:
2019-04-24
Revision:
13:d04a6caba40d
Parent:
11:63e54f6e7939
Child:
14:3361879490b2

File content as of revision 13:d04a6caba40d:

#include "Bullets.h"

Bullets::Bullets(float pos_x, float pos_y, int dir){
    moving = true;
    face = 0;
    hp = 1;
    hitbox.width = 2;
    hitbox.height = 2;
    position.x = pos_x;
    position.y = pos_y;
    sprite_size.width = 2;
    sprite_size.height = 2;
    sprite_size.offset_x = 0;
    sprite_size.offset_y = 0;
    direction = dir;
}

void Bullets::move(float speed, float unused){
    position.x += (direction < 2)*speed;
    position.y += (direction < 2)*speed;
}

int * Bullets::get_frame(){
    return (int *) bullets_sprite;
}