alright ive been working on fuzzy love, im reimplementing the c++ side of love becuase 1) it's fun and 2) i hate messing with other peoples code.
i have the following classes fully functional:
*Audio witch implements the type for love.audio
*Timer witch implements the type for love.timer
*Drawable the super class of all drawable objects
*Image witch implements the type returned by love.graphics.newImage
*ParticleSystem witch implements the type returned by love.graphics.newParticleSystem
*Source witch implements the type returned by love.audio.newSource
*Event witch implements the type for love.event (i did things differently here becuase of how glfw works and how i like things to work)
i have the following classes partially functioning:
*Engine the type for love
*Graphics the type for love.graphics
*Keyboard the type for love.keyboard
*Mouse the type for love.mouse
here is a simple program that demonstrates some of it's current features (I'm uploading the windows executable for this)
Code: Select all
#include "include/fuzzy_love.h"
#include "include/fuzzy_audio.h"
#include "include/fuzzy_graphics.h"
#include "include/fuzzy_mouse.h"
#include "include/fuzzy_engine.h"
#include "include/fuzzy_keyboard.h"
using FuzzyLove::Audio;
using FuzzyLove::Drawable;
using FuzzyLove::DrawablePtr;
using FuzzyLove::Image;
using FuzzyLove::ImagePtr;
using FuzzyLove::Source;
using FuzzyLove::SourcePtr;
using FuzzyLove::Graphics;
using FuzzyLove::Engine;
using FuzzyLove::ParticleSystem;
using FuzzyLove::ParticleSystemPtr;
int main(int argc,char * argv[]) {
Engine love(1024,1024,"Fuzzy Love");
love.mouse.setVisible(false);
SourcePtr MySource = love.audio.newSource("prondisk.xm",FuzzyLove::Stream);
MySource->play();
MySource->setLooping(true);
bool running = true;
double theta = 0, dt;
short x=100,y=100;
int mx=0,my=0;
unsigned char s[]={200,0,255,255},e[]={0,255,0,128};
ImagePtr zombie = love.graphics.newImage("zombie.png");
ImagePtr background = love.graphics.newImage("BackGround.png");
ImagePtr BloodSpater = love.graphics.newImage("BS.png");
ParticleSystemPtr p = love.graphics.newParticleSystem(BloodSpater,300);
p->setEmissionRate(50);
p->setSpeed(60, 60);
p->setGravity(200);
p->setSize(1, 0.5);
p->setPosition(0, 0);
p->setLifetime(-1);
p->setParticleLife(3);
p->setDirection(FuzzyLove::PI*1.5f);
p->setSpread(FuzzyLove::PI/2.0f);
p->setColor(s,e);
p->setSize(1.0f,0.2f,1.0f);
while(running) {
running = love.event.poll();
dt = love.timer.getDelta();
p->setPosition(mx, my);
p->update(dt);
mx = love.mouse.getX();
my = love.mouse.getY();
theta = atan2(my-y,mx-x) + FuzzyLove::PI/2.0f;
love.graphics.clear();
glColor3f(1.0f,1.0f,1.0f);
love.graphics.draw(background,0,0);
love.graphics.draw(zombie,x,y,theta,1,1,32,32);
love.graphics.draw(p,0,0);
if(love.keyboard.isDown('W')) {
y-=5;
}
if(love.keyboard.isDown('A')) {
x-=5;
}
if(love.keyboard.isDown('S')) {
y+=5;
}
if(love.keyboard.isDown('D')) {
x+=5;
}
love.graphics.present();
love.timer.step();
}
return 0;
}
*note: there is currently a bug in witch you mouse will remain invisible after it leaves the window. you should just be able to press escape to exit the program