Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

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.


Topics - Lo-X

Pages: [1]
1
SFML projects / [LD48 #31] Dark Rabbit
« on: December 08, 2014, 05:16:14 pm »
Hi there,

I did this weekend Ludum Dare (31th edition) and here the game I ended up with.



Dark Rabbit is a game in which you are a evil genious, for a rabbit. You want to take your revenge on the kid that tortured you while a little cute mini rabbit. To do that, you decide to kill all kids you'll encounter. Of course kids tend to catch you too, when they're smart enough.


Let's get technical

Of course I used C++11 with SFML, still with my little framework base on the still awesome SFML Game Development Book.
I used QtCreator as editor. I used gimp to make all graphic stuff, Audacity, sfxr and autotracker.py for audio.

I will post the sources on GitHub as soon as the Jam edition stops and I have some time to do it. So stay tuned.

I developed it on Linux (mint) and ported it aferwards on Windows.


I would like to thank SFML team for that awesome library as well as writers of SFML Game Development for that awesome book (some of you guys got two thanks :) ).


Links :
- Ludum Dare entry
- Downloads on my personal website
- Sources on github

2
SFML projects / Noodle - Game Framework
« on: June 15, 2014, 06:09:06 pm »
Hi community !

I'm starting a new project that I would like to share with you.

Noodle

Noodle is/will be a game framework in C++/Lua. It's inspired by my Potato framework (itself very strongly inspired by SFML Game Development Book) but I planned some improvement.

Features

So this framework will contain, more or less :
- Windowing + Rendering
- Resources
- Events
- Screens / Game States
- Entity/Components
- Simple GUI
- Animations
- Particles
- Json + Json serialization

Goals

The goal is to have a strong "engine" in C++ completely binded to Lua, so that when you develop a game you just write Lua.
Bind some SFML features to Lua.
To be able to copy/paste an executable and then just change Lua code to make a new game.

There's a lot of work to do, the most of it will be done when I need it (SFML Jam here  come). I also encourage you to fork/issue/participate anyhow, you will be welcomed :)


Inspirations - Other libs

So it's philosophically inspired by LÖVE (a lot) somehow.
It's also inspired by some of your libs like Thor, Featherkit, etc. but I don't know yet if I can bind them directly to Lua.

I use Selene as Lua C++11 wrapper, even if I have trouble with static methods...

Examples

What the Lua code looks like at the moment  - main.lua

local Noodle = require("scripts/Noodle/noodle");

function Init()
        Noodle.Application.setWindowTitle("It Works !");

        print("Init function called");
end

function Step(dtInSeconds)
        --print("Step "..dtInSeconds);
        if Noodle.Mouse.isButtonPressed(Noodle.Mouse.Button.Left) then
                print("Left Mouse Button pressed {".. Noodle.Mouse.x() .." ; ".. Noodle.Mouse.y() .." }");
        end
end

function Render()

end

function Quit()
        print("Goodbye !");
end

There are three mandatory functions/hooks : Init() , Step(..) and Render() and some facultative ones. These hooks are parsed once and then directly called by C++.
C++ and Lua classes are indistinctly accessible through the Noodle Lua table.

Links

Noodle GitHub Repo (check de dev branch)
Potato-framework GitHub Repo

3
General discussions / Ludum Dare #28
« on: December 13, 2013, 03:03:40 pm »
Hi there !

Who's going for the 28th Ludum Dare this week end (with SFML of course) ? 48h or 72h jam ?

I'll propably participate, not sure yet because I'll not be able to code all week end. It would be great to see some SFML games posted around here ! I also prefer to test SFML games first !

See you this week end :)

4
SFML projects / [LD 27] 10 seconds barrier
« on: August 25, 2013, 11:21:10 pm »
This week end I've submited my very fist Ludum Dare game : 10 seconds barrier.


Quote
You're an athlete that wants to get under the 10 seconds barrier in a 100m race. Can you ?

To accelerate, press your keyboard keys while your character is running over the corresponding letter on the lane. But don't miss if you don't want to slow down !

The difficulty and the speed increase after every race you win !

 
My experience for this LD48 #27

I was very worried about the time, 48h isn't much to do a game when you're coding it in C++ from scratch ! Plus I'm very not an artist and I'm alone, so I wanted to do something very simple that I could finish within the 48 hours.

The result is that I finished the basic game and arts in 24h, so I decided to get into another challenge for me : network my game ! Indeed I never did it before (for a game), so it was tricky. I finished just in time, with some bugs : I can't get internet network game working every time, but it works in LAN. Wierd. Well, I learned things, that was the point !


Technical points

The game was made entirely with SFML (every modules), with my potato framework based on the SFML Game Development Book that, once again, helped me a lot THANKS !. I had trouble to set up the network part and there's still some network bug I don't understand, but I learned a lot (and it works on my LAN so whatever).
 

You can find my entry post here

Download for windows

Download for linux (x64)



 

Improvements

I think I'm gonna add some more characters. It was funny to add a unique posture to each one of them, even if I'm not a graphist and my artwork is approximative.

I'll definitely fix nnetworking part as well. Sounds like I will use it in other games. It's always fun when you can play with friends.

I'll add some levels between level. Difficulty is growing hard and it's repetitive. I thought about adding an infinite mode, longer levels, variable distance between and number of key zones. Perhaps event objects for networking mode, that can alter letters, slow down players ahead... Fun stuff !

5
Graphics / [solved] sf::RenderTexture is inverted
« on: August 24, 2013, 07:16:31 am »
Edit : found the solution ><

int main() {
    sf::Sprite runner;
    sf::Texture text;
    text.loadFromFile("textures.png");
    runner.setTextureRect(sf::IntRect(0,0,32,32));
    runner.setTexture(text);
    runner.setPosition(sf::Vector2f(0,0));

    sf::RenderTexture scene;
    scene.create(800,600);

    scene.draw(runner);

    sf::RenderWindow window(sf::VideoMode(800, 600), "My window");

    // run the program as long as the window is open
    while (window.isOpen())
    {
        // check all the window's events that were triggered since the last iteration of the loop
        sf::Event event;
        while (window.pollEvent(event))
        {
            // "close requested" event: we close the window
            if (event.type == sf::Event::Closed)
                window.close();
        }

        sf::Sprite spr;
        spr.setTexture(scene.getTexture());

        window.clear();
        window.draw(spr);
        window.display();
    }
}

Of course everything is fine if I directly draw the sprite on window

I'm using Ubuntu but I've report of the same thing with my previous game on windows

6
SFML projects / [LandS] SFML Jam Game
« on: August 04, 2013, 10:08:15 pm »
LandS - Lights and Shadow



Hi there.

This is a exploration/find the exit game. You're in a castle that is haunted by ghosts, well, you're a GhostBuster on your spare time... Get your slime gun ready and find the exit !


Please note that the game isn't fully finished, but there iseverything you need to enjoy it for a while !

Indeed it includes :
- 3 levels (tuto + 2 big levels)
- Slime
- Keys and doors
- More slime
- Lights
- Walls (if everything goes right, non-buggy)
- Shrooms and Slime-Shrooms
- Ghosts of course !

If there is still bugs, speling or grammar mistakes (I'm french and I suck at grammar), please let me know here !

I plan to do updates, so keep informed !


Next Updates :

- Restart level when failed
- Pickup objects (healing potions, battery for torch, invunerability pack, ...)
- A title screen with a background
- Good looking menus
- Different ghosts, more levels and bosses (well, not now...) !


Download :

Linux (x64)
Linux (x32)
Windows

Note that I'm a Linux user, so it my not work very well on windows, especially if you have a not-recent graphic card or outdated drivers...
Readme are joined

Did anyone passed level 3 :p ?

7
General / Tilemap : drawing out of window
« on: July 28, 2013, 10:47:31 pm »
Hi,

I've just a simple question : I've a tilemap that is bigger than the window (the view has a viewport equal to window size) and I render it every frame. What happen to things that are out of the window ? Are they rendered too by GPU or is it automatically skiped ?

8
SFML website / Forum header on chrome
« on: May 07, 2013, 12:22:34 pm »
Thre's a probluem with the forum header on Chrome (at least).

The "french forum" and "search" buttons are glued to the right side of the screen and there is no logo anymore.

I tried on Firefox and it was fine.

9
Graphics / Why shapes does strech texture (and not sprite) ?
« on: April 28, 2013, 02:54:23 pm »
Hi there,

I've a problem : I need a giant circle to have a texture that is repeated inside of it. Let say the circle radius is 1024px, my texture is 512x512px. The problem is the texture does not repeat itself (with texture.setRepeated(true)) and is stretched to fit the circle size (so the texture is "zoomed").
I do not have this problem with a sprite of 1024x1024, the texture is well repeated.
I do not understand because sf::Sprite and sf::Shape both inherit from sf::Transformable

Minimal code :

int main()
{
    sf::RenderWindow window(sf::VideoMode(2048, 1024), "Ant");


    sf::Texture ground; // ground is 512x512
    ground.setSmooth(true);
    ground.setRepeated(true);
    ground.loadFromFile("ground.png");

    float radius = 1024;
    sf::CircleShape planet;
    planet.setOrigin(radius, radius);
    planet.setTexture(&ground);
    planet.setRadius(radius);
    planet.setPointCount(radius*180);
    planet.setPosition(1024, 512);
   
    // It works with a sprite
    /*sf::Sprite spr;
    spr.setTextureRect(sf::IntRect(0,0,2048,2048));
    spr.setTexture(ground);*/


    // on fait tourner le programme jusqu'à ce que la fenêtre soit fermée
    while (window.isOpen())
    {
        // on inspecte tous les évènements de la fenêtre qui ont été émis depuis la précédente itération
        sf::Event event;
        while (window.pollEvent(event))
        {
            // évènement "fermeture demandée" : on ferme la fenêtre
            if (event.type == sf::Event::Closed)
                window.close();
        }

        window.clear();

        window.draw(planet);
        //window.draw(spr);

        window.display();
    }

    return 0;
}

Any ideas, remarks, insults ?

Edit and Note : I've tried many different things such as add a planet.setTextureRect(), but nothing makes it

[attachment deleted by admin]

10
Graphics / Lights
« on: May 02, 2012, 01:08:09 am »
Hi,

For my game I need a few lights. Not a full light system with wall detection, etc.. No, just some points that "glow".

I found two solutions to do it, but I don't know wich is the best :

1) I just use a sf::CircleShape with a texture of a circular gradient from white to black (transparent), I can use setColor to color it and I draw it each frame with an additive blend mode => simple

2) I use a class to store a vextex array of triangles, my color, my position etc... I calculate the color of each verticle before to add them in the array. I can draw the vextex array with additive blend mode (inspired from Gregouar light system). I haven't tested this solution yet

As it is for a very simple light system, I'm tempted by the first solution, however I wonder if there are any advice or warnings about each solution (like the rendering speed, ...) ?

I haven't spoken about shaders because I can't figure how the hell they work :p

11
SFML projects / Isaac - Very simple physics engine
« on: April 29, 2012, 11:24:54 pm »
Hi,

I'm actually developing a re-usable Game Engine for my platform game and I needed to handle some basic physics. I first decided to use Box2D but there was too many things for me and it was difficult to integrate it with my engine. So I bought a vey good book on making basics 3D Physics engines. Some things were complicated or useless in 2D so I used it as a base for doing my own engine, easy to integrate with my SFML Game engine.

I don't pretend to re-invent the wheel, tis is a veeerrrryyyyy basic engine that can handle the minimum :
- Implement Rigid Bodies with sf::Shape fixtures
- Generate forces on Bodies with the possibility for user to implement non-trivial Forces Generator : (Gravity and Draw forces generator already implemented)
- Integrate (linear) Forces, Velocity and Acceleration on bodies
- Handle collision between Bodies (if they have Convex Shapes) using Separating Axis Theorem
- Very (very very) simple rotations angular velocities/accelerations (the result isn't very convincing)


Example of code :

Code: [Select]
// A Register of global forces to apply. Will be included in a "Physic" or "World" general class :
isaac::ForceRegistry registry;
// A gravity generator :
isaac::GravityGenerator gravity(isaac::Vector2(0.f, 150.f));

// Add a body
isaac::Body cube;
cube.setPosition(300, 320);
cube.setMass(500);
    // Fixtures
        isaac::Fixture f1;
        f1.RelativePosition = isaac::Vector2(0,0);
        f1.Shape = &cubeShape; // Just a sf::RectangleShape
cube.addFixture("base",f1); // There is a key string, I think about removing it

// Applies forces
registry.add(&cube, &gravity);

// Main loop :
sf::Clock clock;
float timestep = 0.f;
while(1)
{
     // Events...
     registry.updateForces(timestep);
     cube.intergrate(timestep);

     // Draw, using the shape or a body method to get all fixtures
}



Here a short video :

http://www.dailymotion.com/video/xqh60v_isaac-simple-physics-engine_videogames



There are a few bugs, I haven't documented every functions, so ATM I can't provide anything.

12
SFML projects / Galaxy
« on: August 28, 2011, 09:11:52 pm »
Hi ! Now that my project is advanced, I post a topic about it on the english forum.



Galaxy is a 2D space shooter in which you control the energy distribution in the spaceship. Do you need energy in weapons ? Motors ? Shields ? You're the captain, you decide !

History

In year 3035, the Earth has been destroyed by the Thorgs, an alien race met while human beeing was exploring the Galaxy... Only some spaceships could escape, they decided to hide survivors on the remaining colonies. A plan is setting up to retrieve an engine witch could permit, in theory, to come back in the past in order to save the Earth from destruction...

Developpement

Only one or two space objects and the campaign mode aren't implemented yet.

Gameplay

You have to allocate the energy between 3 modules
- Shields : more energy = more shield recuperation at each tick
- Weapons : more energy = more damages
- Motors : more energy = more speed

Gamepad and joysticks can be used but the mouse is required for some actions.

Keybind is dynamic.

There will be a demonstration version soon, the time for me to add at least one campaign level.

Demo :

http://monstruosor.com/accueil/download/galaxy/

Video :

Short video here!

13
Window / Strange things with Gamepad
« on: August 15, 2011, 08:13:15 pm »
Hello

I tried the last build of SFML 2 with the new sf::Joystick and I saw a strange thing while using it with a gamepad, I don't know if it's normal or not.

If I Use this code :

Code: [Select]
int main(void)
{
      // App = sf::RenderWindow
     sf::Joystick::Update();
     int MyJoystickNumber = 0;
     for(int i = 0; i < 8; i++)    
          if(sf::Joystick::IsConnected(i)) {  
               MyJoystickNumber = i; break;
          }

     // Some code

     // Problematic code
     if(sf::Joystick::GetAxisPosition(MyJoystickNumber, sf::Joystick::X) < -40)
          cout << "Turn Left !" << endl;
}


In fact, "Turn Left !" just never appear, the Joystick number is not my gamepad number and I've nothing else than a mouse and a keyboard on the computer.

If I have a table of joystick's numbers and I check all these joysticks, the message appear.
So my game works well and the new interface is nice, but I'm obliged to check 2 Joysticks instead of one in a single game loop.

14
Graphics / [Solved] How to : Flash light
« on: June 27, 2011, 07:20:21 pm »
Hi,

I would like to have a big Flash Light for my game when something explode.
But I don't know how to proceed, I think that I may use Shaders, but on what ?
A sprite ? The shader will only be applied on the texture of the sprite so, bad idea
A render image ? But how can I have the flash ?

If you have some advices, it will be with pleasure =)

15
Graphics / Question about sf::RenderImage
« on: June 26, 2011, 11:37:41 pm »
Just a simple question :

Why would sf::RenderImage::IsAvailable() return false ? (For what reason(s)) ?

Pages: [1]
anything