56
« on: November 18, 2008, 12:23:32 PM »
I would use either an inventory or a window full of buttons, but in the window, you have to handle the activation/deactivation of spells yourself, including uncluttering the buttons. If you have fixed button positions, leaning spells in different order will clutter up the window while leaving spaces in between.
On the other side, an Inventory window handles all this cleanup all by itself.
A Third option would be a Spell-Button, which triggers a special dialogue, where the response options are the spells currently available. So you could enable spells on the fly while opening the dialogue.
About applying spells anytime in the game:
With Inventory use, you just select the spell and apply it to an object, as if you would combine them. The engine handles the rest.
When using a dialogue or window based approach, you could do the following: Then you set a variable "activeSpell" from "" to the name of the choosen spell. In the game leftclick handler, you check wether an object is clicked. If an object is clicked, you check wether activeSpell is "" or set. If it's set, apply the spell event to the object (and reset activeSpell to "").