Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help with my game
#1
Hi people. Im making a maze game that involves controlling a car through a maze to collect passengers on points in the maze before time runs out.

Now, i already made a maze using tens and tens of line commands. I also have the data set for my car graphic.

My question is, how do I make my car move with my arrow keys and how do I keep it from passing through the maze?

Also, how do I make the time clock keep ticking throughout the game?

Lastly, how do I keep track of the player scores?

If anyone knows any source codes out there for maze games, time games and games with "hall of fames", it would really help.

Thanks.
Reply
#2
By keep track I mean listing the player and his score according to the highest score from 1-10. I understand, I need to use double arrays? How do I do this.

I uploaded my qbasic file although im not quite sure it will work for all qbasic versions. www.angelfire.com/punk2/jabronyo/ui.bas
Reply
#3
Using type structures.

To make you understand it easily, think about your library's card files, those cards which hold title, author, year of publication, etc. You have a set of many cards, every card containing the same info.

Type structures work the same, you can make an array of registers all of them containing the same info.

For example, the library example could be coded in QB this way:

Code:
TYPE cardFileType
   title AS STRING * 80
   author AS STRING * 30
   year AS INTEGER
END TYPE

DIM MyBooks(999) as cardFileType

That way you can store 1000 (0 to 999) books in memory. You can access your array "fields" (that's how they are called) very easily:

Code:
MyBooks(7).title = "Neverending Story"
MyBooks(7).author = "Michael Ende"
MyBooks(7).year = 1979

Code:
PRINT "Book number 100's title: "; MyBooks(100).title
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#4
Quote:TYPE cardFileType
title AS STRING * 80
author AS STRING * 30
year AS INTEGER
END TYPE

DIM MyBooks(999) as cardFileType
what is the *80 and *30 do
his world has been connected...
Tied to the darkness.
Soon to be completely eclipsed.
There is so very much to learn...
You understand so little.
A meaningless effort.
One who knows nothing can understand nothing.
-Ansem Bringer of darkness and creator of the heartless
Reply
#5
Defines the length of the string

this makes title always 80 characters long
and author always 30 characters long
[Image: sig.php]
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)