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.


Messages - Dubmosphere

Pages: [1]
1
SFML projects / Chip-8 Emulator C++/SFML
« on: May 03, 2017, 11:09:53 pm »
Hey SFML Community

Just wanted to share my latest project aside from work. Wanted to take a look at emulation and found Chip-8 is good to start with, although it is just an interpreter. So I implemented my version using SFML for output. It is just a simple few days project and not really beautifully coded but I was very proud to see it working with some games I downloaded for Chip-8 on the web because I had the feeling this would be a really hardcore job (what in the end wasn't that a hardcore job, just instruction mapping to C++ and representing the chip-8 architecture with a simple (and pretty ugly...) class).

You can download the source code and build it here:

https://bitbucket.org/dubmosphere/chip8emu

Games I tested with (Not really all of them):

https://www.zophar.net/pdroms/chip8/chip-8-games-pack.html

I know the code is not the most intuitive but it works pretty well I think :D

2
Window / Re: Mouse isButtonPressed doesn't work
« on: January 27, 2015, 02:12:41 pm »
Thanks for the link,

I finally got it working with this.

3
Window / Re: AW: Mouse isButtonPressed doesn't work
« on: January 27, 2015, 01:10:53 pm »
I built it last week with the sources from git. But I downloaded it again today and built it again and the problem still exists.

Should I try it with the 2.2 Sources?

4
Window / [SOLVED] Mouse isButtonPressed doesn't work
« on: January 27, 2015, 11:50:44 am »
Hello, I'm creating a Mapeditor and now I need sf::Mouse::isButtonPressed(sf::Mouse::Button::Left). The Problem is, even when i press the left mousebutton, the method returns false. I don't know why this happens but it happens on the smallest example too. So it may be a bug in SFML or am I doing something wrong?

I compiled SFML 2.2 static on Linux with GCC 4.9.2 64bit, if this Information helps.

Thanks for your help.

Even on this small example it happens:
#include <iostream>
#include <SFML/Graphics.hpp>

int main(int argc, char **argv) {
    sf::RenderWindow window(sf::VideoMode(800, 600, 32), "Example", sf::Style::Close);
    window.setFramerateLimit(60.f);

    while(window.isOpen()) {
        sf::Event event;
        while(window.pollEvent(event)) {
            switch(event.type) {
                case sf::Event::Closed:
                    window.close();
                    break;
                default:
                    break;
            }
        }

        if(sf::Mouse::isButtonPressed(sf::Mouse::Button::Left))
            std::cout << "Hello left button" << std::endl;

        window.clear();

        window.display();
    }

    return 0;
}
 

5
General / [SOLVED] SFML 2.2 Linux static linking
« on: January 10, 2015, 01:49:27 pm »
Hello,

I wanted to link SFML statically on Linux Mint 17. I know that all dependencies have to be linked.
It worked in SFML 2.1 but since SFML 2.2 you switched to xcb so I'm getting those Errors (Used compiler: g++ 4.9.2 64bit):

VideoModeImpl.cpp|| Undefined reference to `XGetXCBConnection'|
VideoModeImpl.cpp|| Undefined reference to `XGetXCBConnection'|
WindowImplX11.cpp|| Undefined reference to `XSetEventQueueOwner'|
WindowImplX11.cpp|| Undefined reference to `XGetXCBConnection'|
WindowImplX11.cpp|| Undefined reference to `XSetEventQueueOwner'|
WindowImplX11.cpp|| Undefined reference to `XGetXCBConnection'|
GlxContext.cpp|| Undefined reference to `XGetXCBConnection'|
GlxContext.cpp|| Undefined reference to `XGetXCBConnection'|
GlxContext.cpp|| Undefined reference to `XGetXCBConnection'|
Display.cpp|| Undefined reference to `XGetXCBConnection'|
/usr/local/lib/libsfml-window-s.a(Display.cpp.o):Display.cpp|| Further Undefined references to `XGetXCBConnection' follow|
||=== Build failed: 11 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|


These are the libraries I linked:

-lsfml-network-s
-lsfml-audio-s
-lsfml-graphics-s
-lsfml-window-s
-lsfml-system-s
-lsndfile
-lopenal
-lX11
-lX11-xcb
-lxcb
-lxcb-randr
-lxcb-icccm
-lxcb-image
-ludev
-lpthread
-lGLEW
-lfreetype
-ljpeg
-lGL

The Code I want to run is only a simple window without anything else.

Thanks for your help :D

EDIT:
Solved, had to link -lX11-xcb too, the above list is complete and should work :)

6
SFML projects / Tilemap Collision for Platformer
« on: October 01, 2014, 09:57:06 pm »
Here is a little example of my tilebased collision detection for platformers...
I made it because i want to make a platformer.
Tell me how you find it.. if you have to tips to optimize it just say...

I know that if you are too fast and too near at an edge (for example if you are jumping and the top of the player is just touching a tile with his top right / left edge), you will not be stopped by the block but pushed away... this is because my collision response is really nooblike but I'm glad it works as good as that :)

http://download.lima-city.de/hazeler/AABBTiles.zip


7
SFML projects / Re: Pacman with SFML
« on: July 06, 2014, 03:55:17 am »
I made a Pacman-style game as my first game and I used the information found in The Pacman Dossier, which is where information that Nexus linked to originally came from (it's listed in its sources).

I'd recommend starting with Blinky as that ghost takes the simplest route and is easiest to understand. Then, the technique used to make the ghost find its way to where it wants to go can be used for the other ghosts too.

You can visualise the map as a single-width path with double-width walls, rather than a double-width path. This helped me immensely.

I think it it's the only game that I made (complete) so I'd be happy to discuss the innards of it, but I didn't exactly implement everything perfectly (I had no "ghost home") so don't expect too much from me  ;D I spent most of my time with the game adding features to learn more about things, especially SFML, which is why I added a music player and volume controls, language files, etc.. Also, my code is terrible in it; the main() function is about 1700 lines long  :-[

What do you mean with single-width-paths? Sorry if it's a dumb question but I don't really understand... Do you mean the width of the "ways"?

8
SFML projects / Re: Pacman with SFML
« on: July 03, 2014, 11:48:33 pm »
The first you need is a pathfinding function/method, then you can start making the AI

I'll take a look on the sourcecode of your pacman... i think it's really cool and is really similar to the original :D it's really interesting how you've done that :)

9
SFML projects / Re: AW: Pacman with SFML
« on: July 03, 2014, 11:06:28 pm »
Oh look another Swiss person! :D

There are full blown articles on the internet that describe how the AI of each ghost works. Implementing it is a different thing though. With same Finite State Machines it should still be fairly easy.

I know there are many articles about the bahavior of the ghosts but the point is I have no plan how to realize that in code^^... I'll try to implement clyde first because he moves randomly^^ I have absolutely no idea how to implement the other ones maybe I should try to do some simpler games first^^

10
SFML projects / Re: Pacman with SFML
« on: July 03, 2014, 05:34:05 pm »
I tried it but it seems to be a bit buggy  :-\



You can see my version i made months ago here

http://en.sfml-dev.org/forums/index.php?topic=12939

ooh I have to recompile the windows version... I've changed the Spritesheet^^

11
SFML projects / Pacman with SFML
« on: July 03, 2014, 05:27:43 pm »
Hello, I'm really new to SFML and I don't know if it's the best idea to start game programming with pacman :D The only thing left is the AI for the ghosts but I don't really know how to realize that... So maybe I start AI programming with tic-tac-toe or so... If somebody of you has an Idea how to realize an AI for Pacman-ghosts (it doesn't care if the behavior of the ghosts (blinky, pinky, inky and clyde) is different), please tell me :) I'd really appreciate it because if I have that, my first game is (almost) done...

I realized that the ghosts and pacman use more than one tile, in my version they only use one tile... Is it even possible to realize an AI for the ghosts that way (maybe somebody of you knows that)?

You can compile the code on windows and linux, on mac it isn't tested

Sorry for my bad english I'm Swiss

Edit:
New Download Link
http://download.lima-city.de/hazeler/Pacman.rar

Edit:
I still haven't done an AI, but I have some ideas how to do it. I learned alot about OOP last week and I really begin to understand the whole objectorientation rather than just watching tutorials without all of the technical terms... Books for ever :D

12
General / Re: Tilemap movement with a std::vector problem
« on: June 30, 2014, 10:29:47 am »
Quote
Something tells me your x and/or y values are ending up outside the range of your tilemap.

Yes I know, but I don't know why the player is moving if he has reached the right end of the map... he should only move if his position (/32 because of his movements are the same size as the tiles) is in the map...

Edit:
I simply made the tilemap one tile wider and higher and set it to collide... that way it works, but doesn't look pretty well coded... Thanks anyway

13
General / [SOLVED]Tilemap movement with a std::vector problem
« on: June 30, 2014, 01:00:33 am »
Hello, I'm trying to implement a tilemap engine for making a tetris or jump n run... the collision detection works but i have no clue why the programm crashes if i touch the border of the window... everytime I get out of the window the following message appears:

terminate called after throwing an instance of 'std::out_of_range'
  what():  vector::_M_range_check
Aborted

here is my movement:

    if(isMovingUp) {
        unsigned int x = hero.getPosition().x / 32;
        unsigned int y = hero.getPosition().y / 32 - 1;

        if(y >= 0) {
            if(map.getTile(x, y).collision == false) {
                hero.setPosition(x * 32, y * 32);
            }
        }
    }

    if(isMovingDown) {
        unsigned int x = hero.getPosition().x / 32;
        unsigned int y = hero.getPosition().y / 32 + 1;

        if(y < map.getSize().y) {
            if(map.getTile(x, y).collision == false) {
                hero.setPosition(x * 32, y * 32);
            }
        }
    }

    if(isMovingLeft) {
        unsigned int x = hero.getPosition().x / 32 - 1;
        unsigned int y = hero.getPosition().y / 32;

        if(y >= 0) {
            if(map.getTile(x, y).collision == false) {
                hero.setPosition(x * 32, y * 32);
            }
        }
    }

    if(isMovingRight) {
        unsigned int x = hero.getPosition().x / 32 + 1;
        unsigned int y = hero.getPosition().y / 32;

        if(x < map.getSize().x) {
            if(map.getTile(x, y).collision == false) {
                hero.setPosition(x * 32, y * 32);
            }
        }
    }
 

Pages: [1]