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

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

0 Members and 1 Guest are viewing this topic.

Mortal

  • Sr. Member
  • ****
  • Posts: 284
    • View Profile
Re: Car Racing For Beginners
« Reply #15 on: December 04, 2015, 08:23:40 am »
UPDATE

  • Separated the source code into .h and .cpp files
  • Added cars to the road
  • Applied collision between player and cars

Demo:
« Last Edit: December 04, 2015, 09:07:59 am by MORTAL »

Brax

  • Newbie
  • *
  • Posts: 39
  • Wannabe C++ Game Developer
    • View Profile
Re: Car Racing For Beginners : Finished
« Reply #16 on: December 04, 2015, 04:51:31 pm »
Looks awesome! :D

Mortal

  • Sr. Member
  • ****
  • Posts: 284
    • View Profile
Re: Car Racing For Beginners : Finished
« Reply #17 on: December 04, 2015, 05:17:57 pm »
Looks awesome! :D
thanks Brax, i'm so glad you like it

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Car Racing For Beginners : Finished
« Reply #18 on: December 05, 2015, 04:50:01 am »
Looks good. You've managed to reproduce the Javascript demo version in the tutorial in C++ with SFML rather well!  :)

Now fix the cars so that you can't always see the right-hand side of them  ;)
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 : Finished
« Reply #19 on: December 05, 2015, 08:57:29 am »
Looks good. You've managed to reproduce the Javascript demo version in the tutorial in C++ with SFML rather well!  :)
thanks Hapax, it seems after all, it is easy to change code from HTML5/javascript to c++/SFML. (IMHO), javascript is C/C++ like no extra job needed to convert it. however ,HTML5 is bit harder but it can be managed. it took me 2 days to get familiar with HTML5/javascript synthetics and code's data and strictures, to be able to convert them to C++/SFML.

Now fix the cars so that you can't always see the right-hand side of them  ;)
yeah, this is indeed a problem, also, i left the AI implementation it is bit ineffective even in original tutorial, for example, if there is heavy traffic ahead the cars rubberbanding left and then right as they try to squeeze through a gap between 2 other vehicles. this is not good and it gives bad expression of game, it needs to rewrite a new robust AI algorithm.

and for textures unfortunately the origin sprite-sheet has only the right-hand textures of cars, i don't know how make new textures for them. it needs artist, surely i'm not :-\
« Last Edit: December 05, 2015, 09:17:17 am by MORTAL »

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Car Racing For Beginners : Finished
« Reply #20 on: December 05, 2015, 11:01:30 pm »
and for textures unfortunately the origin sprite-sheet has only the right-hand textures of cars, i don't know how make new textures for them. it needs artist, surely i'm not :-\
Flip the horizontal scale of the sprite.
e.g.
if the sprite's scale is 2x2, make it -2x2 (notice the negative width)
Voila! The left side of the car  ;)
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 : Finished
« Reply #21 on: December 06, 2015, 04:46:34 am »
Flip the horizontal scale of the sprite.
e.g.
if the sprite's scale is 2x2, make it -2x2 (notice the negative width)
Voila! The left side of the car  ;)
oh, that's clever :)
i always wondering what does negative value for scaling mean as mentioned in transform tutorial in sfml official site.
now, it much better even it needs more works to get perfect view for cars.   
« Last Edit: December 06, 2015, 05:43:00 am by MORTAL »

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Car Racing For Beginners : Finished
« Reply #22 on: February 11, 2016, 08:43:03 pm »
I randomly wandering onto this thread again so I watched the videos again! I still like how it looks :) Did you ever improve the car side views? ;D

Unfortunately, while re-watching these videos, I noticed something else  :(

When objects are passing the car (very close to the camera), they rise upwards. You can see it in your videos for v2 and for v3. To see what I mean, just drive close to a road-side object (that is near the road) and pass it slowly.
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 : Finished
« Reply #23 on: February 12, 2016, 01:23:01 pm »
I randomly wandering onto this thread again so I watched the videos again! I still like how it looks :) Did you ever improve the car side views? ;D
thank you, yes i did it, but some of cars were drawing with large side view angle and its movement didn't looks appropriate when i flipped their textures on road curves, only one car that's fit the flipping.

Unfortunately, while re-watching these videos, I noticed something else  :(

When objects are passing the car (very close to the camera), they rise upwards. You can see it in your videos for v2 and for v3. To see what I mean, just drive close to a road-side object (that is near the road) and pass it slowly.
yes, i did notice  that and it is indeed annoying, i tried to fixed but no avail  :-\
i'm currently working in Wolfenstein 3D game engine still not finished but i did level and sliding door and its code need bit refactory.
probably i will post it in screenshot thread soon.

 

anything