SFML community forums

General => SFML projects => Topic started by: Valiunia on July 11, 2013, 07:13:15 pm

Title: 2D platformer using SFML 2.0 and Box2D 2.2.1
Post by: Valiunia on July 11, 2013, 07:13:15 pm
So,
This is my first project, Im kinda new to all of this things: c++, sfml, box2d...
I never programmed before, only a bit in our school we learn pascal (teacher said its good if you plan to study programming later )
and to learn more about all of this things on my own I started this project

so far there is only one 2 minutes gameplay level, with bunch of different blocks as platforms and objects such as crates, coins and hearts(1up) there is also two types of enemies - fly and slime

Some things was too hard for me to do so I came up with my own ideas which turned to be bad and good...

I used free textures and sounds for my game so in some way its not how I imagined it at first, but anyways  heres the download link (http://ge.tt/2oZBCTl/v/0?c?c)

and heres a gameplay video :)
http://youtu.be/p1rVbiaV3oI
sorry for bad video quality :C

I don't know name for it yet and I haven't thought much about lore
Anyways, feel free to say what you think about it, if its horrible just say so, I can take it :P

P.S. theres still some bugs mostly due to Box2D which is very hard for me sometimes :)
Title: Re: 2D platformer using SFML 2.0 and Box2D 2.2.1
Post by: Grimshaw on July 11, 2013, 10:03:39 pm
Amazing job for a first project!! I'm happy to see this, keep it going :D
Title: Re: 2D platformer using SFML 2.0 and Box2D 2.2.1
Post by: eXpl0it3r on July 11, 2013, 11:36:03 pm
This is really good! :)
Could need some tuning for the acceleration/deceleration of the player but other than that it's more than many of the people in the forum have ever achieved and given that's your first game, congrats! :D
Title: Re: 2D platformer using SFML 2.0 and Box2D 2.2.1
Post by: Valiunia on July 12, 2013, 10:13:06 am
Thank you very much, guys! :)
that acceleration thing with inertia and friction is Box2D's i tried to fix that but it made some funny bugs,
ill spend some time more on this later, some people say that hard controls makes this game harder which makes it more interesting to play :P

Do you think I might get chances on kickstarter.com ? To get for example 100-200 $ :P
Ofc, kickstarter shouldnt be my attitude, but I have seen some really lame games that got even 1000$ :P
Title: Re: 2D platformer using SFML 2.0 and Box2D 2.2.1
Post by: Grimshaw on July 12, 2013, 10:42:44 am
You can try! I wouldn't say to you its likely to succeed, but who knows? :D
Title: Re: 2D platformer using SFML 2.0 and Box2D 2.2.1
Post by: Nexus on July 12, 2013, 03:01:21 pm
Really cool for the first project! You are quite ambitious to start with C++, SFML and Box2D at once :)

I like jump'n'runs a lot, there are tons of possibilities to add features. Especially when you use Box2D, you can create really interesting gameplay mechanisms. But don't forget to steadily learn C++, many people make the mistake of focusing on features from the very beginning, and thus they always struggle with the code. Keep in mind that as soon as you want to approach a bigger project, a solid code fundament is the most important part. Just a tip ;)
Title: Re: 2D platformer using SFML 2.0 and Box2D 2.2.1
Post by: Valiunia on July 12, 2013, 03:52:16 pm
Really cool for the first project! You are quite ambitious to start with C++, SFML and Box2D at once :)

I like jump'n'runs a lot, there are tons of possibilities to add features. Especially when you use Box2D, you can create really interesting gameplay mechanisms. But don't forget to steadily learn C++, many people make the mistake of focusing on features from the very beginning, and thus they always struggle with the code. Keep in mind that as soon as you want to approach a bigger project, a solid code fundament is the most important part. Just a tip ;)

Very true, I need more practice with c++, a lot more
Title: Re: 2D platformer using SFML 2.0 and Box2D 2.2.1
Post by: hipsterdufus on July 12, 2013, 11:33:40 pm
Since you're new to C++, did you avoid using classes/object orientation? How did you handle collision detection? This is pretty impressive for a first timer, how long did it take you?
Title: Re: 2D platformer using SFML 2.0 and Box2D 2.2.1
Post by: Valiunia on July 13, 2013, 10:59:07 am
Since you're new to C++, did you avoid using classes/object orientation? How did you handle collision detection? This is pretty impressive for a first timer, how long did it take you?
I spend about month only on c++, 2 weeks on sfml, and something around 2-3 weeks on this project

I did used classes, but only for very few things because its still hard for me to understand everything about it and there is things i just dont get :D

When I decided to make a game I tried to do my own collision detection based on coordinates, but then I decided to use Box2D for physics since I thought you need to be God to make your own :P and in Box2D there is already  collision detection, and its very easy to make objects react with others in you own way, but still Box2D is pain in the ass for me

so yeah, like 2-3 weeks of work :P
Title: Re: 2D platformer using SFML 2.0 and Box2D 2.2.1
Post by: gaulois94 on July 13, 2013, 04:42:54 pm
Very good for a first project, espacially if you are new on C++ and sfml. You had to spend many time on front of your computer during this 2 mouth :) .
Title: Re: 2D platformer using SFML 2.0 and Box2D 2.2.1
Post by: Valiunia on July 13, 2013, 07:24:29 pm
Very good for a first project, espacially if you are new on C++ and sfml. You had to spend many time on front of your computer during this 2 mouth :) .

Yup, every day for like 3 hours sometimes up to 8 hours if its got interesting :D
Title: Re: 2D platformer using SFML 2.0 and Box2D 2.2.1
Post by: cpolymeris on July 14, 2013, 07:32:22 am
Amazing for a first project as others have said. Might I recommend some parallax movement? that would look great, even if it was only one layer.
Title: Re: 2D platformer using SFML 2.0 and Box2D 2.2.1
Post by: Valiunia on July 14, 2013, 11:36:29 am
Amazing for a first project as others have said. Might I recommend some parallax movement? that would look great, even if it was only one layer.

Hmm, parallax movement is something like this ?

(http://upload.wikimedia.org/wikipedia/commons/a/ab/Parallax.gif)

Looks like serious trick :P Ill think about it
Title: Re: 2D platformer using SFML 2.0 and Box2D 2.2.1
Post by: G. on July 14, 2013, 11:45:34 am
Just scroll your background image at a slower speed than player and foreground platforms. :p
(parallax scrolling) (http://en.wikipedia.org/wiki/Parallax_scrolling)
Title: Re: 2D platformer using SFML 2.0 and Box2D 2.2.1
Post by: Valiunia on July 14, 2013, 01:12:59 pm
Just scroll your background image at a slower speed than player and foreground platforms. :p
(parallax scrolling) (http://en.wikipedia.org/wiki/Parallax_scrolling)

Aaaaa, I get it now :D thanks :P
I will add this to my project in future :P