Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Leting the player save the game 1

Status
Not open for further replies.

CodeHunter

Technical User
Dec 13, 2002
6
0
0
US
Ok let me break this down. First off I'm not a great programmer. I'm more of an animator and deal with such things as 2d and 3d animation. However, I use to do a little programming in qbasic and found Darkbasic. I've been working out the code for a few days now and have enough info to make a game. Such as sprite movement, scolling sprites, and even collision. The only part I don't have down is how do you set up a game to allow the player to save their place in the game. That way they can come back to it later and play it. Could someone please help me in this matter? The subject of the game in question is a RPG (Role Playing Game)
I can also be emailed at vrdungeon@yahoo.com
Thank you for anyone that gives in the time to help me out.
 
You can use variables, and then write them into files. Example:

input "Enter your savegame filename >",save$
open to write 1,save$ + ".sav"
write float 1,xposition#
write float 1,yposition#
close file 1

To load:

input "Enter your old savegame filename >",load$
open to read load$ + ".sav"
read float 1,xposition#
read float 1,yposition#
close file 1
paste sprite 1,xposition#,yposition#

yposition# and xposition# would be the variables for the sprite's position on the screen. Also, you can check the command glossary at:
Or try the forums at:
 
What exactly is Darkbasic? I'm familiar with Qbasic and have heard of Darkbasic but I'm not sure what it is.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top