Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Trying to open an old game from a new one

Author
Message
Daygamer
14
Years of Service
User Offline
Joined: 16th Mar 2010
Location: United States
Posted: 11th Aug 2010 22:22
Hey all

I'd like to add an arcade room to my current project. I'd like to use some of my old smaller games for the arcade.

I also need to have the player's money increase depending on how well they do in the arcade. So I need to pass out to score variable or something?

Other than just copying the code into my new project and making it a sub routine, is there a nice way to open up my old game from my new one.

I've tried using the #include command and the open to read command.

thanks guys! I always appreciate you being generous with your knowledge.

Coding is just better with music
God Bless!
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 11th Aug 2010 23:18 Edited at: 11th Aug 2010 23:18
take a look at the execute file and execute executable commands if you desire one program (ie, "Arcade.exe") to launch another (ie, "Asteroids.exe").

as for passing a value (ie, a player's current "Cash") from one program to another, i think the simplest solution is to write a file containing, say, the player name and their current "bank account" while directing each game in the arcade to read and update the amount accordingly.

Virtual Nomad @ California, USA
AMD Phenomâ„¢ X4 9750 Quad-Core @ 2.4 GHz . 8 GB PC2-6400 RAM
ATI Radeon HD 3650 @ 512 MB . Vista Home Premium 64 Bit
Daygamer
14
Years of Service
User Offline
Joined: 16th Mar 2010
Location: United States
Posted: 12th Aug 2010 01:19
ah, cool, thanks, Virtual Nomad. Those commands were just what I was looking for. awesome

I'm not quite sure I completely understand the second half of your answer about as for passing a value, but I will play around with it and post again if I don't if I haven't got it figured out. thanks

Coding is just better with music
God Bless!
luskos
17
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 13th Aug 2010 19:44
All your games need to save/load exactly the same way.You can use one file to save your player stats and share it with all games.When you leave one game, save stats to the file, start second game and load stats back.That's what Virtual Nomad said, but with some other words

Coding is My Kung Fu!
And My Kung Fu is better than Yours!
Daygamer
14
Years of Service
User Offline
Joined: 16th Mar 2010
Location: United States
Posted: 13th Aug 2010 20:18
okay, I get that. What kind of file is recommended to save stats into?

Coding is just better with music
God Bless!

Login to post a reply

Server time is: 2024-11-23 11:06:05
Your offset time is: 2024-11-23 11:06:05