1
SFML projects / Re: Game: survival , creative , multiplayer
« on: April 10, 2012, 10:43:50 pm »
Will do as soon as I get to a computer i am using a android.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
#pragma once
#include "SFML/Graphics.hpp"
class Block
{
public:
void SetBoundingBox(int offSetX, int offSetY, int width, int height);
void SetPosition(int x, int y);
Block();
virtual void Initialize(sf::Image &image);
virtual void Update(sf::RenderWindow &window);
virtual void Draw(sf::RenderWindow &window);
virtual bool ContainsPoint(int x, int y); //doesn't check if the edges are hit
virtual bool CollidesWithPoint(int x, int y); //checks edges and inside
void output();
bool active;
protected:
sf::Sprite blockSprite;
int hardness, objId, health, maxHealth;
int offsetX, offsetY, width, height; //bounding box
int positionX, positionY;
};
#pragma once
#include "Block.h"
class GrassBlock : public Block
{
public:
void Initialize(sf::Image &image);
void Draw(sf::RenderWindow &window);
void Update(sf::RenderWindow &window);
};