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

Author Topic: Car Racing For Beginners : Finished  (Read 18801 times)

0 Members and 1 Guest are viewing this topic.

Mortal

  • Sr. Member
  • ****
  • Posts: 284
    • View Profile
Car Racing For Beginners : Finished
« on: November 30, 2015, 01:09:40 pm »
i was reading about pseudo-3d racing game. the tutorial is here in this link below it's short and easy for read especially for beginner but unfortunately, it is for javascript language, the challenge is how to  make it in C++/SFML. Humbly i have done my first attempt in make this game.

Demo:



the tutorial: http://codeincomplete.com/posts/2012/6/22/javascript_racer/.
« Last Edit: April 13, 2020, 08:00:04 pm by Mortal »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Car Racing For Beginners
« Reply #1 on: November 30, 2015, 02:00:15 pm »
This looks quite neat. Makes me want to implement my own thingy. :D
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Mortal

  • Sr. Member
  • ****
  • Posts: 284
    • View Profile
Re: Car Racing For Beginners
« Reply #2 on: November 30, 2015, 02:21:17 pm »
i'm glad you like it eXpl0it3r.

i would like to see your version of this game  ;)
it quite simple even the math behind it is some how easy to grasp.

Ungod

  • Newbie
  • *
  • Posts: 44
    • View Profile
Re: Car Racing For Beginners
« Reply #3 on: November 30, 2015, 03:34:17 pm »
This has a nice immersion of speed!

Mortal

  • Sr. Member
  • ****
  • Posts: 284
    • View Profile
Re: Car Racing For Beginners
« Reply #4 on: November 30, 2015, 03:47:27 pm »
This has a nice immersion of speed!
yeah, if someone focused on road, he will feel that ;D

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Car Racing For Beginners
« Reply #5 on: November 30, 2015, 05:46:42 pm »
This looks really good. Good work!

Did you find that it made a big difference when you added something in the distance (i.e. your background)? I think it really fills out the view :)

The road itself looks pretty cool, a lot like the one in the tutorial.

Just a couple of minor points to improve (as seen in the video):
  • There are flickering light horizontal lines on the track, quite near the horizon. This is the only thing that looks "bad".
  • There is oddness in the track! When slightly moving, or stopped after moving, the track "bloats". It can be see at the beginning (0:02) and end (1:12) but most notably after stopping at (0:12).
    I don't know if this is the case but it looks like the expansion of the width of the track as it travels towards the bottom of the screen is either ahead or behind the movement of the "camera's" position.
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

Mortal

  • Sr. Member
  • ****
  • Posts: 284
    • View Profile
Re: Car Racing For Beginners
« Reply #6 on: November 30, 2015, 06:24:15 pm »
    This looks really good. Good work!

    Did you find that it made a big difference when you added something in the distance (i.e. your background)? I think it really fills out the view :)

    The road itself looks pretty cool, a lot like the one in the tutorial.
    thanks Hapax, i'm so glad you like it. yes a lot of differences when i added background  to the scene.in my humble opinion, i believe successful games is relying on graphics.

    Just a couple of minor points to improve (as seen in the video):
    • There are flickering light horizontal lines on the track, quite near the horizon. This is the only thing that looks "bad".
    good point, i didn't notice this flickering before. i edited repo, i have fixed it.

    Just a couple of minor points to improve (as seen in the video):

    • There is oddness in the track! When slightly moving, or stopped after moving, the track "bloats". It can be see at the beginning (0:02) and end (1:12) but most notably after stopping at (0:12).
      I don't know if this is the case but it looks like the expansion of the width of the track as it travels towards the bottom of the screen is either ahead or behind the movement of the "camera's" position.
    sorry, i couldn't see the oddity on track. in video above slightly i can say there is some sort of bloats in the track. but when i ran the exe file in my PC it seems fine. it is very hard to tell so, it's confusing.

    Elias Daler

    • Hero Member
    • *****
    • Posts: 599
      • View Profile
      • Blog
      • Email
    Re: Car Racing For Beginners
    « Reply #7 on: November 30, 2015, 08:56:06 pm »
    This looks really awesome, great job
    Tomb Painter, Re:creation dev (abandoned, doing other things) | edw.is | @EliasDaler

    Mortal

    • Sr. Member
    • ****
    • Posts: 284
      • View Profile
    Re: Car Racing For Beginners
    « Reply #8 on: December 01, 2015, 08:54:58 am »
    This looks really awesome, great job
    thank you,
    the easy part is done, i have finished the road geometries only. but there is more need to implement like game entities, collision, Al... etc

    Elias Daler

    • Hero Member
    • *****
    • Posts: 599
      • View Profile
      • Blog
      • Email
    Re: Car Racing For Beginners
    « Reply #9 on: December 01, 2015, 09:25:05 am »
    thank you,
    the easy part is done, i have finished the road geometries only. but there is more need to implement like game entities, collision, Al... etc
    Don't forget to separate the code by putting it into different files. It would be much easier to read it that way :D
    Tomb Painter, Re:creation dev (abandoned, doing other things) | edw.is | @EliasDaler

    Mortal

    • Sr. Member
    • ****
    • Posts: 284
      • View Profile
    Re: Car Racing For Beginners
    « Reply #10 on: December 03, 2015, 07:13:11 am »
    Don't forget to separate the code by putting it into different files. It would be much easier to read it that way :D
    thanks for advise, but the game is fairly small and dont think it worths to be in separate files.

    UP DATED
    • added side road objects
    • implemented collision

    Demo

    Elias Daler

    • Hero Member
    • *****
    • Posts: 599
      • View Profile
      • Blog
      • Email
    Re: Car Racing For Beginners
    « Reply #11 on: December 03, 2015, 08:16:41 am »
    thanks for advise, but the game is fairly small and dont think it worths to be in separate files.
    It's always worth it. :)
    As the game gets bigger, it's easier to refactor and manage stuff.

    The update looks very awesome, by the way. Great job! :D
    Tomb Painter, Re:creation dev (abandoned, doing other things) | edw.is | @EliasDaler

    Mortal

    • Sr. Member
    • ****
    • Posts: 284
      • View Profile
    Re: Car Racing For Beginners
    « Reply #12 on: December 03, 2015, 09:29:44 am »
    thanks for advise, but the game is fairly small and dont think it worths to be in separate files.
    It's always worth it. :)
    As the game gets bigger, it's easier to refactor and manage stuff.

    The update looks very awesome, by the way. Great job! :D
    thanks for complements. you are absolutely right, but this project was made for education purpose, i don't know if i will make it full game or stop at where it become. since i have implemented most of essential parts like road geometries and game's entities and collision.

    Elias Daler

    • Hero Member
    • *****
    • Posts: 599
      • View Profile
      • Blog
      • Email
    Re: Car Racing For Beginners
    « Reply #13 on: December 03, 2015, 02:12:21 pm »
    thanks for complements. you are absolutely right, but this project was made for education purpose, i don't know if i will make it full game or stop at where it become. since i have implemented most of essential parts like road geometries and game's entities and collision.
    I think that it's easier to study ways to structure stuff in smaller projects, because it's pretty hard to do in bigger projects, because you have to move a lot of things around. Once you understand how to structure and decouple stuff in your smaller project, you'll start writing your next projects using this structure. :)

    Oh, and there are other benefits, of course. Once you put start putting stuff in .h and .cpp recompilation will be a lot faster, because there'll be less stuff to recompile. Now you're recompiling everything in your one file.
    This isn't a problem in a small project, probably, but will become much bigger once the project starts getting bigger.
    « Last Edit: December 03, 2015, 02:14:51 pm by Elias Daler »
    Tomb Painter, Re:creation dev (abandoned, doing other things) | edw.is | @EliasDaler

    Mortal

    • Sr. Member
    • ****
    • Posts: 284
      • View Profile
    Re: Car Racing For Beginners
    « Reply #14 on: December 03, 2015, 03:58:49 pm »
    thanks for complements. you are absolutely right, but this project was made for education purpose, i don't know if i will make it full game or stop at where it become. since i have implemented most of essential parts like road geometries and game's entities and collision.
    I think that it's easier to study ways to structure stuff in smaller projects, because it's pretty hard to do in bigger projects, because you have to move a lot of things around. Once you understand how to structure and decouple stuff in your smaller project, you'll start writing your next projects using this structure. :)

    Oh, and there are other benefits, of course. Once you put start putting stuff in .h and .cpp recompilation will be a lot faster, because there'll be less stuff to recompile. Now you're recompiling everything in your one file.
    This isn't a problem in a small project, probably, but will become much bigger once the project starts getting bigger.
    absolutely, i agree with that, thanks for valuable info, i will keep it in my mind, and for this project i have 3 classes only and its functionality can be implemented directly. for readability sake, i separated them in classes.
    « Last Edit: December 03, 2015, 04:01:20 pm by MORTAL »

     

    anything