Qbasicnews.com
April 09, 2020, 05:30:36 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Design question  (Read 1269 times)
SadButTrue
New Member

Posts: 5


« on: July 31, 2004, 11:32:56 AM »

I have been wanting to program a game for a while now, and decided I would make a wrestling simulator.  I was wondering which technique would be the best to organise moves. I was thinking of creating an array for each move attribute. For example, say I made a list of moves and then numbered them, and perhaps Dropkick was move number 11. Would it be wise to then create arrays for each attribute like Damage, StaminaRequired, etc , and then assign dropkick these attributes, like Damage[11] , StaminaRequired[11]?

I think this would work, but would there be a better way to do it?
Logged
eno_on
Senior Member
**
Posts: 210


« Reply #1 on: July 31, 2004, 12:31:31 PM »

use a 2 dimensional array - like so

DIM move(11,3) as INTEGER

move number:   1   2   3   4   5   6   7   8   9   10   11
damage amunt: 10 20  15 10 5   3   20 10 50  5    30
stamina req:     5   10  3   8   8   10 15 1   25  0    10

so move(1,1) would be 1 and (11,3) would be 10

increase the 1st dimension for more moves and the 2nd dimension for more attributes.  I'd add an extra row or two for the animation sequence.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!