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

Author Topic: 2D platformer using SFML 2.0 and Box2D 2.2.1  (Read 21098 times)

0 Members and 1 Guest are viewing this topic.

Valiunia

  • Newbie
  • *
  • Posts: 9
    • View Profile
    • Email
2D platformer using SFML 2.0 and Box2D 2.2.1
« 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

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 :)
« Last Edit: July 11, 2013, 07:17:36 pm by Valiunia »

Grimshaw

  • Hero Member
  • *****
  • Posts: 631
  • Nephilim SDK
    • View Profile
Re: 2D platformer using SFML 2.0 and Box2D 2.2.1
« Reply #1 on: July 11, 2013, 10:03:39 pm »
Amazing job for a first project!! I'm happy to see this, keep it going :D

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10800
    • View Profile
    • development blog
    • Email
Re: 2D platformer using SFML 2.0 and Box2D 2.2.1
« Reply #2 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
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Valiunia

  • Newbie
  • *
  • Posts: 9
    • View Profile
    • Email
Re: 2D platformer using SFML 2.0 and Box2D 2.2.1
« Reply #3 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

Grimshaw

  • Hero Member
  • *****
  • Posts: 631
  • Nephilim SDK
    • View Profile
Re: 2D platformer using SFML 2.0 and Box2D 2.2.1
« Reply #4 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

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
Re: 2D platformer using SFML 2.0 and Box2D 2.2.1
« Reply #5 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 ;)
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Valiunia

  • Newbie
  • *
  • Posts: 9
    • View Profile
    • Email
Re: 2D platformer using SFML 2.0 and Box2D 2.2.1
« Reply #6 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

hipsterdufus

  • Newbie
  • *
  • Posts: 28
    • View Profile
    • Email
Re: 2D platformer using SFML 2.0 and Box2D 2.2.1
« Reply #7 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?

Valiunia

  • Newbie
  • *
  • Posts: 9
    • View Profile
    • Email
Re: 2D platformer using SFML 2.0 and Box2D 2.2.1
« Reply #8 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

gaulois94

  • Sr. Member
  • ****
  • Posts: 259
    • View Profile
Re: 2D platformer using SFML 2.0 and Box2D 2.2.1
« Reply #9 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 :) .

Valiunia

  • Newbie
  • *
  • Posts: 9
    • View Profile
    • Email
Re: 2D platformer using SFML 2.0 and Box2D 2.2.1
« Reply #10 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

cpolymeris

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
    • Email
Re: 2D platformer using SFML 2.0 and Box2D 2.2.1
« Reply #11 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.

Valiunia

  • Newbie
  • *
  • Posts: 9
    • View Profile
    • Email
Re: 2D platformer using SFML 2.0 and Box2D 2.2.1
« Reply #12 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 ?



Looks like serious trick :P Ill think about it

G.

  • Hero Member
  • *****
  • Posts: 1590
    • View Profile
Re: 2D platformer using SFML 2.0 and Box2D 2.2.1
« Reply #13 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)

Valiunia

  • Newbie
  • *
  • Posts: 9
    • View Profile
    • Email
Re: 2D platformer using SFML 2.0 and Box2D 2.2.1
« Reply #14 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)

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