Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Programming spells
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Alex Schroeder  
View profile  
 More options Dec 1 1995, 3:00 am
Newsgroups: rec.games.design
From: a...@zool.unizh.ch (Alex Schroeder)
Date: 1995/12/01
Subject: Re: Programming spells
On 30 Nov 1995 17:34:17 -0500, MikeB22198 wrote:

> How would you program spells in a game?  Individual code for each
> spell?

That's what I did. Some spells can be grouped tho, since their effect
only varies in quantity (eg. killing up to 10 people, or killing up to
1000 people). In these cases the spells can be put into an array with
the respective name, level, cost, description and effect, and this
group of spells can be handled by the same functions (using the array
index). In my game there are several groups of spells: combat spells
killing people, combat spells healing people, and a lot of indiviual
spells such as water poisoning, fire infernos, teleportation etc. The
individual spells are all coded individually (one big switch
statement). Before the switch which makes alle the effects, there is
one common part, checking for the ability of the unit to cast the
spell, deduce the money needed etc.

My game is a translated, improved version of Russel Wallace's game
Atlantis 1.0. (I hope that I got his name right, from the top of my
head).

Alex.
--
Grofzg! Mofzg! NagaNnaga! NnnaAARGHGAA! Agha! Naganahhagga!
PGP public key available on request from a...@zool.unizh.ch


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.