Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 EoE - Help Thread
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
.hack




PostPosted: Sat Feb 21, 2004 5:54 pm   Post subject: EoE - Help Thread

I'm making an RPG for my end opf the year project. Right now I am just working out the different character properties.

For now, its going to be rather small, so I made it so the class gets 5 weapons total, throughout the game. Should I create the weapons as Records?

here is an Example.

var reDarkHalo
record
HPMod: int := 0
MPMod: int := 0
StrMod: int := 10
DefMod: int := 0
MagAMod: int := 0
MagDMod: int := 0
EvadeMod: int := 0
LuckMod: int := 0
ExpMod: int := 0
end record


I also noticed you can't set values for the variables in the record, which peeves me, is there any way I can do this (like how it has StrMod : int := 10. Can I set a value without it giving me an error?

And should I continue using records for each weapon data.
Sponsor
Sponsor
Sponsor
sponsor
Cervantes




PostPosted: Sat Feb 21, 2004 6:00 pm   Post subject: (No subject)

records are good. Definately use them. They aren't hard to learn and you gotta learn them sometime, so might as well Smile

if all those Mod's that you have there are for one weapon, you're going to have a lot of variables. Another thing you could do is make those an array, and comment which element of the array is what.
BioHazardousWaste




PostPosted: Sat Feb 21, 2004 10:25 pm   Post subject: (No subject)

What is EoE, the name of your game or something?

Yes... you should definetaly make an array of a record, or you will have way the hell too many variables.
Delos




PostPosted: Sun Feb 22, 2004 11:43 am   Post subject: (No subject)

Records are the way to go...for sure.

But...

Instead of just plain records...go for types, thus ways you can at least make arrays. You'll need those for the multitude of chars you may have...

code:

type rpgChar:
record
name : string
type : string
minHP : int
maxHP : int
moveList : array 1..5 of string
movePwr : array 1..5 of int
end record

var randomChar : array 1..10 of rpgChar

% initialize here...
% eg
% randomChar(1).name := "Muwahaha"
% Etc...maybe use a for loop for the numbers parts.



There...have fun...good luck.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: