|
-
Aug 25th, 2004, 01:53 PM
#1
Testing C++ highlighting
Code:
#include "mage.h"
#include "fireball.h"
#include "level.h"
Mage::Mage(Level *l, DrawEngine *de, int s_index, float x, float y, int lives)
: Character(l, de, s_index, x, y, lives)
{
classID = MAGE_CLASSID;
}
bool Mage::keyPress(char c)
{
bool val = Character::keyPress(c);
if (val == false)
{
if (c == keys.attack)
{
castSpell();
return true;
}
}
return false;
}
void Mage::castSpell(void)
{
if (isValidMove((int)pos.x + facing.x, (int)pos.y + facing.y))
{
Fireball *temp = new Fireball(lvl, dengine, SPRITE_FIREBALL, (int)pos.x + facing.x,
(int)pos.y + facing.y, facing.x, facing.y);
lvl->addNPC((Sprite *)temp);
}
}
-
Aug 25th, 2004, 02:09 PM
#2
Ex-Super Mod'rater
Re: Testing C++ highlighting
Originally posted by Cander
Code:
#include "mage.h"
#include "fireball.h"
#include "level.h"
Mage::Mage(Level *l, DrawEngine *de, int s_index, float x, float y, int lives)
: Character(l, de, s_index, x, y, lives)
{
classID = MAGE_CLASSID;
}
bool Mage::keyPress(char c)
{
bool val = Character::keyPress(c);
if (val == false)
{
if (c == keys.attack)
{
castSpell();
return true;
}
}
return false;
}
void Mage::castSpell(void)
{
if (isValidMove((int)pos.x + facing.x, (int)pos.y + facing.y))
{
Fireball *temp = new Fireball(lvl, dengine, SPRITE_FIREBALL, (int)pos.x + facing.x,
(int)pos.y + facing.y, facing.x, facing.y);
lvl->addNPC((Sprite *)temp);
}
}
hehe cool, mind wont take much code to fill up the limit .
When your thread has been resolved please edit the original post in the thread (  )
and amend "-[RESOLVED]-" to the end of the title and change the icon to  , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

-
Aug 25th, 2004, 02:19 PM
#3
True. But in most case if someone is posting a bit of code, they are posting a protion of it. Otherwise they casn split it up.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|