Jump to content

  • Log In with Google      Sign In   
  • Create Account


Advice on Creating GTA 2 like game play


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 Fs02   Members   -  Reputation: 384

Like
0Likes
Like

Posted 08 February 2013 - 10:31 AM

Hi, i'm prototyping a 2d top down game with a similiar game play like the old gta 2 game.

my aim now is to make my character can ride any vehicles and i need some advice how to make it

 

here is what i think :

- i'll make a class thats can store a pointer to any object it's being controlled in void variable than cast it to original object to gain access to it's member function ( very doubt here).

 

- since in box2d we can't temporary hide physics body from world(tell me if you know how :) ) i'll delete my character when it's ride any vehicles and recreate it when it's no more riding its vehicle.

 

please tell me what do you think, thanks :)

 

PS : Sorry for my bad english :)


[my game in #ggj14 : http://www.indiedb.com/games/romance-stalker [my blog : http://surya.volge.net ]


Sponsor:

#2 AngryPlatypus   Members   -  Reputation: 232

Like
1Likes
Like

Posted 08 February 2013 - 08:26 PM

Hi there,

 

1. i don't like a void pointer here. For me void means it can be pretty much everything. But your character shall only drive vehicles and not buildings or other characters right? Why not use a base class like "Drivable" or "Vehicle" i.e. use Polymorphism here?

 

2. body->SetActive(false) should do it.


Edited by AngryPlatypus, 08 February 2013 - 08:28 PM.


#3 Fs02   Members   -  Reputation: 384

Like
0Likes
Like

Posted 08 February 2013 - 09:35 PM

1. i don't like a void pointer here. For me void means it can be pretty much everything. But your character shall only drive vehicles and not buildings or other characters right? Why not use a base class like "Drivable" or "Vehicle" i.e. use Polymorphism here?

yes void is not a good solution and thanks for pointing polymorphism because i don't even think about it since i'm not realy understand what it is for, but after some research on google i found that's very useful technique :)

 

2. body->SetActive(false) should do it.

again thanks, it's work perfectly :)


[my game in #ggj14 : http://www.indiedb.com/games/romance-stalker [my blog : http://surya.volge.net ]





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS