Topic Options
#127420 - 02/03/09 11:07 PM how to implement upgrades in a racing game?
knpdude


Registered: 02/03/09
Posts: 4
hello all, it's nice to be posting on the clickteam forums once again after many many years.

i've decided to get into kliking again. this time my weapon of choice is the games factory 2 for its simplicity yet many many features. it is a huge step forward IMO

anyhow my question is how would i go about implementing upgrades for things like engine, tires, etc that are possible to be altered? i figure global values are a start, but still im stumped.. any help is appreciated

Top
#127466 - 02/04/09 08:18 AM Re: how to implement upgrades in a racing game? [Re: knpdude]
Jeff


Registered: 06/28/06
Posts: 4631
Loc: Oregon
Yes you are on the right track.

For the engine upgrade for example.

You could have a base speed of the car -- lets say 50
It will be moving at speed 50 without any upgrades

So when they upgrade the engine you want it to be 5 faster.

You would store the 5 point upgrade in an global value called "engine_speed"

Then in your game set the speed of the car to 50+ global value engine_speed
_________________________
Flyin V Interactive


Top
#127486 - 02/04/09 10:46 AM Re: how to implement upgrades in a racing game? [Re: Jeff]
CloudWolf


Registered: 02/05/08
Posts: 360
Loc: uk
or flags...

when the player gets the upgrade put flag 1 on

flag 1 is on... set speed to whatever!
_________________________
MY GAMES:G.I.JANE 1,MOUSEO REVERSO and bloodshed!!
MY WEBSITE IS: http://cloudwolfgames.weebly.com/
first i was waterembryo
then i was watervapourpup
after that cloudpup
now i am...CLOUDWOLF

Top
#127491 - 02/04/09 11:13 AM Re: how to implement upgrades in a racing game? [Re: CloudWolf]
Jeff


Registered: 06/28/06
Posts: 4631
Loc: Oregon
Well the good things about using a value is the player can purchase a second upgrade that makes it even faster.

Simply by changing the value in the global value.
_________________________
Flyin V Interactive


Top
#127512 - 02/04/09 12:54 PM Re: how to implement upgrades in a racing game? [Re: Jeff]
TreeHugger


Registered: 06/05/07
Posts: 358
Loc: Suffolk, UK
Originally Posted By: Jeff
For the engine upgrade for example.

You could have a base speed of the car -- lets say 50
It will be moving at speed 50 without any upgrades

So when they upgrade the engine you want it to be 5 faster.

You would store the 5 point upgrade in an global value called "engine_speed"

Then in your game set the speed of the car to 50+ global value engine_speed

Jeffs way works quite well. This is pretty much exactly the way I've been doing it in a racing game I've been playing around with. Only difference is that I'm using Alt Values in each car rather than Global Values so that the AI cars can individually upgrade as well.
_________________________
MMF2 Standard
-----
http://treehugger.elementfx.com

Top
#127521 - 02/04/09 01:26 PM Re: how to implement upgrades in a racing game? [Re: TreeHugger]
knpdude


Registered: 02/03/09
Posts: 4
well the only problem I had with setting the speed of a car to whatever at the beginning of a frame is that.. it wouldn't happen! i don't know why, but for example if i do "Condition 1 is true, set Car 1 to Speed 55" the car doesn't actually move any faster. to prove that i set it to a speed like 100 and it didn't make any difference.. not sure why? is there a common explanation for it?

Top
#127524 - 02/04/09 01:53 PM Re: how to implement upgrades in a racing game? [Re: knpdude]
DavidN


Registered: 06/30/06
Posts: 2208
Loc: Boston, MA, USA
If the car's being controlled via the user controlled movement "Race car", then I think its speed is constantly changed by the movement rather than the events, so you wouldn't see any effect. Does "Set maximum speed" have the effect you're after?

Top
#127529 - 02/04/09 02:10 PM Re: how to implement upgrades in a racing game? [Re: DavidN]
knpdude


Registered: 02/03/09
Posts: 4
that makes sense!

i tried maximum speed and garnered the same results. however i could have done something wrong, maybe i'll download the demo here at work and try out a couple of things.

however thanks for pointing that out, im sorry i didn't mention that i was using the race car movement, how silly of me. Jeff perhaps you could speak a little more on this one; am i going wrong or is this normal?

Top
#127648 - Yesterday at 01:07 PM Re: how to implement upgrades in a racing game? [Re: knpdude]
knpdude


Registered: 02/03/09
Posts: 4
OK so setting maximum speed worked. im gonna try the other variables to see if they work as well but.. i'll consider this one figured out!

thanks again guys i appreciate it

Top


Site Links
Forum Index

Home Page
Online Store
Tutorials
Download Center
French Forum
Quick File Links
Multimedia Fusion 2
Updates - build 248
Standard Version
Developer Version

Extension Packs
Bonus Pack 1
Bonus Pack 2
z33z Extension Pack
LIJI Extension Pack

The Games Factory 2
Latest Update - build 248
Community Links
Madword Arcade

GameBuilder
Fusion2Developers
The Daily Click

Extensions
Neatwares Extension List
Extension Updater (FusionUpdater)
Zoom Gamer
Click Chat
6 People are chatting