Hello everyone
Well i'm having a big problem in manipulating memory blocks. I'll start from the beginning with the exemples of what i'm trying to fo..
I create an base enemy class and a derived enemy class.
Code:
struct Enemy {
Int pos;
Int type;
virtual void update() {}
}
struct Boss : Enemy {
virtual void update() {pos++;}
}
And i have an enemyManager where I create and manipulate my enemys, and where I have my enemys memory block.
Code:
Memb <Enemy*> enemies
void createEnemy() {
Enemy *_enemy = enemies.New();
_enemy->pos = 0;
}
the game compiles with no errors and no warnings
but when i'm running the game and I create an enemy it breaks and give me and error of memory access violation in here '_enemy->pos = 0;'
I have no ideia why it gives me that error, but i have no clue how to solve it... :?
I'll take advantage of this topic to ask anothe question... how can i have a 2D view in my camera?
Because the camera viewport is a perspective viewport with one point reference in a 3D world, how can i change it to a parallel viewport with no focus point?
best regards
McTomas