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

Author Topic: Well, that's all I could create on my own. Getting a tutorial...  (Read 3569 times)

0 Members and 1 Guest are viewing this topic.

Mark

  • Guest
Well, that's all I could create on my own. Getting a tutorial...
« on: December 21, 2013, 02:08:48 pm »
Hello guys, I was creating a tiny Mario clone using nothing but references to teach myself this library but I realised I won't find out how to handle collisions on my own and I must find a good SFML tutorial to proceed. That's what I'm going to do right now. And I also wanted to show that I wasn't just wasting my time so here's the crap I've created. Anyways, I'm quite satisfied by the menu :D The screenshots:

^Menu^

^Game^
The purpose of the game is to reach the red square. As I repeat, I didn't find out how to handle collisions, so I'm going to get a nice, complete SFML tutorial, how to create a full game, and it's guaranteed to cover the collisions. That's all.

Link to the game: http://www.filedropper.com/game_1

AlexAUT

  • Sr. Member
  • ****
  • Posts: 396
    • View Profile
Re: Well, that's all I could create on my own. Getting a tutorial...
« Reply #1 on: December 21, 2013, 02:30:45 pm »
I'm not quite sure why there are cats flying in the menu^^ But you game does what it should, keep improving it!

The purpose of the game is to reach the red square. As I repeat, I didn't find out how to handle collisions, so I'm going to get a nice, complete SFML tutorial, how to create a full game, and it's guaranteed to cover the collisions.

For the collision part it will be hard to find a SFML related tutorial. Because most of this tutorials are written in "pseudo" code, but you should be able to convert "pseudo" code or even code in different languages (I found a lot written in Action script in the past)  to C++/SFML. Because collision detection is mainly math and math works the same way in every coding language  :)


AlexAUT

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10835
    • View Profile
    • development blog
    • Email
AW: Well, that's all I could create on my own. Getting a tutorial...
« Reply #2 on: December 21, 2013, 02:40:56 pm »
As AlexAUT said articles or tutorials that you can find for the topic of collision detection have rarely anything to do with SFML, but are often rather general, thus you should look fo more general article on collision deection and nearly more importantly how to handle  things after the collision was detected. You might find the following keyword intereting: axis/aligned boundig boxes, hyperplane separation theorem and spatial partiioning.

Yes that is quite a bit of theory and math. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Mark

  • Guest
Re: Well, that's all I could create on my own. Getting a tutorial...
« Reply #3 on: December 21, 2013, 02:45:08 pm »
I'm not quite sure why there are cats flying in the menu.
The cats are flying there because it seemed to be funny and a good opportunity to practice sprites in SFML :) Thanks for trying out the game ;D
But your game does what it should, keep improving it!
Thanks, I will! But I must learn how to handle collisions because now the physics are horrible!
For the collision part it will be hard to find a SFML related tutorial. Because most of this tutorials are written in "pseudo" code, but you should be able to convert "pseudo" code or even code in different languages (I found a lot written in Action script in the past)  to C++/SFML. Because collision detection is mainly math and math works the same way in every coding language  :)
As AlexAUT said articles or tutorials that you can find for the topic of collision detection have rarely anything to do with SFML, but are often rather general, thus you should look fo more general article on collision deection and nearly more importantly how to handle  things after the collision was detected. You might find the following keyword intereting: axis/aligned boundig boxes, hyperplane separation theorem and spatial partioning.
http://www.packtpub.com/sfml-game-development/book
This book is cheap and seems to be a perfect choice! As the contents say, it should teach me collisions and much much more and everything is based on SFML and C++! I'm considering buying it  :)
« Last Edit: December 21, 2013, 02:46:49 pm by Mark »

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
Re: Well, that's all I could create on my own. Getting a tutorial...
« Reply #4 on: December 21, 2013, 04:35:36 pm »
We only use basic collision mechanisms (namely rectangle tests) in the book, so don't expect too much in that regard ;)
However, there was a recent discussion about how you can extend the collision techniques from the book.

About SFML Game Development: As the name says, the book covers the process of developing games using SFML. It covers a wide variety of topics (see publisher website for details) and explains the rationale behind them. It also shows a way to design and build a game architecture where new features are integrated step by step.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

nebula

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
    • Email
Re: Well, that's all I could create on my own. Getting a tutorial...
« Reply #5 on: December 21, 2013, 06:37:17 pm »
https://github.com/nebula2/Pew/blob/master/src%20Visual%20Studio%202013/Collision.h

this is the collision detection for my game.
i am not such a good programmer but maybe you will get the logic behind this ;)

Mark

  • Guest
Re: Well, that's all I could create on my own. Getting a tutorial...
« Reply #6 on: December 21, 2013, 07:06:28 pm »
https://github.com/nebula2/Pew/blob/master/src%20Visual%20Studio%202013/Collision.h

this is the collision detection for my game.
i am not such a good programmer but maybe you will get the logic behind this ;)
Thanks, I'll definitely check out your game and code ;)

Gafuriks

  • Guest
Re: Well, that's all I could create on my own. Getting a tutorial...
« Reply #7 on: December 23, 2013, 05:47:51 pm »
I love the menu!

Mark

  • Guest
Re: Well, that's all I could create on my own. Getting a tutorial...
« Reply #8 on: December 26, 2013, 04:09:01 pm »
I love the menu!
Thanks! I improved it even more. Now it has more cats :D
I've learned how to detect collision between sprites and that is awesome, yet I don't know how that detection exactly works (because I just downloaded the header file from here: https://github.com/SFML/SFML/wiki/Sources and didn't tried to understand it, I was just happy that it works) and how to handle it in a platform game like Mario. I guess I'll make a simpler genre game soon, where collision handling doesn't require that difficulty (no object push backs, only damage infliction).