Simple C++ platforming engine with SFML 2

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

Post Reply
User avatar
Skomakar'n
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 72
Joined: Mon Jul 18, 2011 10:19 pm

Simple C++ platforming engine with SFML 2

Post by Skomakar'n »

Kind of over the course of one night and some hours of the following day I made a basic platforming engine with some help from a friend, who mainly took care of resource management. Initially we were going to actually make a game, but we had gotten into the mindset of programmatic design from the framework writing efforts of the previous day, so we soon went into a generic direction. It was never intended to be anything big, serious or public, but it seems to be working well enough, so I see no reason not to share it, in case anybody finds it difficult to get this kind of stuff working.

Features:
* WASD movement (W = left, D = right, W = jump)
* Gravity
* Walls, grounds, roofs/ceilings and floating platforms are possible (just put blocks anywhere, and the engine should take care of it)
* Camera following
* Resource management for images
* Nothing that's not visible on screen will be drawn, and only stuff within that area and a little bit outside of it will be updated and handled for collision

Common features unfortunately not implemented:
* Slopes
* Wall jumping
* Mid-air extra jumps

Since this was indeed not written with any kind of publication in mind, there is no tutorial on how to use the engine, but there were a couple of blocks and a character implemented, so look through the code and see if you can figure it out. The blocks and the character are added to the level in the Game class.

No licensing rubbish. Just do whatever you want with it. Claim to have written it yourself if you wish. It'd make you a terrible liar, but I won't come after you.

Download our working folder as a .zip here.

Compile and run to try. Uses no other dependencies than STL and SFML 2.
User avatar
short
ES Beta Backer
ES Beta Backer
Posts: 548
Joined: Thu Apr 30, 2009 2:22 am
Current Project: c++, c
Favorite Gaming Platforms: SNES, PS2, SNES, SNES, PC NES
Programming Language of Choice: c, c++
Location: Oregon, US

Re: Simple C++ platforming engine with SFML 2

Post by short »

any updates?
Last edited by short on Fri Jul 27, 2012 5:22 pm, edited 1 time in total.
My github repository contains the project I am currently working on,
link: https://github.com/bjadamson
User avatar
THe Floating Brain
Chaos Rift Junior
Chaos Rift Junior
Posts: 284
Joined: Tue Dec 28, 2010 7:22 pm
Current Project: RTS possible Third Person shooter engine.
Favorite Gaming Platforms: PC, Wii, Xbox 360, GAME CUBE!!!!!!!!!!!!!!!!!!!!!!
Programming Language of Choice: C/C++, Python 3, C#
Location: U.S

Re: Simple C++ platforming engine with SFML 2

Post by THe Floating Brain »

I may play around with it, thanks for sharing!
"Why did we say we were going to say we were going to change the world tomorrow yesterday? Maybe you can." - Myself

ImageImage
Post Reply