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 - Shane

Pages: [1]
1
SFML projects / Re: My Megaman 2 SFML Project *video link fixed*
« on: December 03, 2017, 05:39:35 am »
Thanks.  Fixed the jump it was an issue with the deltatime between frames.

2
SFML projects / Re: My Megaman 2 SFML Project *video link fixed*
« on: December 02, 2017, 01:45:09 am »
Everything is from scratch.  No physics engine no extra libraries, just SFML, C++ and photoshop. 

I did alot of research of how games were programmed for consoles using the M6502 chip. 

Collision Detection
The hardest part was the collision detection.  I kept finding articles regarding 3D collision detection and other over complicated methods.  I finally pieced together how AABB collision detection was done by assigning points on each sprite checking and solving one axis at a time for each point against a tilemap.  I use full rectangles as bounding boxes for sprite to sprite detection.  Once I had that working everything started coming together.

Animation
Honestly didnt do much research in this department.  Just drew it out on paper (yes actual paper .. use it alot when i'm programming)  and made a system that worked for me.

Tilemap & Scrolling
I started dabbling with Tilemaps and scrolling along time ago..One of my first tilemaps with scrolling i made to mimic the early ultima games.  Those only scrolled by a complete tile each step.  The megaman tilemap i made scrolls by  one pixel at a time.  BTW sf:views makes this SOOO much easier! many many iterations later i've got it down to  a science.   

Physics
This I just eye-balled until it looked right.  I had an emulator open beside my Visual Studio all the time counting pixels and time to get an estimate for values to use.

Here is an example of an earlier tile engine i made with SFML.  The animation needs some work.  OBS also makes the scrolling choppy when played back.  It's actually smooth as butter :p



3
SFML projects / Re: My Megaman 2 SFML Project
« on: December 01, 2017, 09:49:57 pm »
Oops.  Forgot to publish the video after uploading to youtube.*Fixed*

4
General / Re: How would i make the games logic
« on: December 01, 2017, 03:13:40 pm »
I find making players, enemies, items, etc. into objects each having their own class easy to work with.  A common approach is to have a base class/interface for each 'type' of object and child classes for the specifics.  This allows for grouping objects of different types into collections (google polymorphism).

For game states logic, implement some sort of state manager that allows easy switching between states.  Make use of the stack for this.  Here is a great tutorial for a simple state manager.
 
https://www.binpress.com/tutorial/creating-a-city-building-game-with-sfml-part-1-state-manager/123

5
SFML projects / My Megaman 2 SFML Project *video link fixed*
« on: December 01, 2017, 06:12:40 am »
I was playing Megaman on my NES and thought to myself, I bet I could make this.  A few days go by and this is the result.  You may notice at times the blocks and sprites have a red border with white dots.  That's just me toggling on/off the collision detection box and hot points for testing.




6
You are absolutely right.  Updated the driver and problem solved. 

If anyone is interest I found the Intel Graphics Driver Bug Report about this on the Intel Developer Zone

https://software.intel.com/en-us/forums/graphics-driver-bug-reporting/topic/737972

Thanks eXpl0it3r

7
Drawing a circleshape to a renderwindow when the window has a title bar the size / scaling is to big. If the windows has sf:style::None (removing the title bar) the shape is rendered correctly. It appears the circleshape is being scaled to fit the windows size including the size of the title bar. A printf of the window size displays the correct size in both cases. See an image illustrating the issue below.



Has anyone else experienced this issue?  or have a solution?

Environment
Lenovo P50s Laptop
Display Adapter: Intel HD Graphics 520 (driver version 21.20.16.4678)
Windows 10 (version 10.0.16299.64)
Visual Studio 2017
SFML 2.4.2 (64x)

Here is the Main.cpp

#include <SFML/Graphics.hpp>

int main()
{
        sf::RenderWindow window(sf::VideoMode(200, 200),"SFML works!", sf::Style::None);
        sf::CircleShape shape(100.f);
        shape.setFillColor(sf::Color::Green);
       
        while (window.isOpen())
        {
                sf::Event event;
                while (window.pollEvent(event))
                {
                        if (event.type == sf::Event::Closed)
                                window.close();
                }

                window.clear(sf::Color::Magenta);
                window.draw(shape);
                window.display();
        }

        return 0;
}
 

Pages: [1]