thats the thing, I have so many classes I don't kow where this weird object is coing from :?
I have like 12 classes, but I woul think the on with shooting might be the problem:
#include "Main.h"
#include "DarkGDK.h"
#include "SC_Collision.h"
#include "Shooting.h"
#include "Player.h"
#include "MakeExtraSpheres.h"
#include "HandleExtraSpheres.h"
#include "MakeLevel.h"
#include "MakePlayer.h"
#define HitObjects 100 // All Objects that the bullet would collide with must be bigger than this
#define BulletObjects 1000 // This is the range from where the code looks for free slots to create new bullets
#define MaxBullets 100 // This is the Max number of bullets to cycle, this effects memory
#define ShootDelay 10 // This is the amount of time between shooting
#define BulletSpeed 10 // This is the speed the bullet travels
#define BulletLife 1000 // The bullet will be killed after this time to prevent it from moving around aimlesly
Shooting_Bullets :: Shooting_Bullets(int objID, char * BulletName)
{
dbLoadObject(BulletName,objID);
objID=BulletID;
}
Shooting_Bullets :: Shooting_Bullets()
{
}
Shooting_Bullets :: ~Shooting_Bullets()
{
dbDeleteObject(BulletID);
}
Shooting_Bullets::Shooting_Bullets(const Shooting_Bullets& copy)
{
this->BulletID = copy.BulletID;
this->Exist = copy.Exist;
this->CurrentBullet= copy.CurrentBullet;
//this->Kill = copy.Kill();
this->Life = copy.Life;
this->Object = copy.Object;
this->ReloadTimer = copy.ReloadTimer;
//this->Run = copy.Run();
//this->Shoot = copy.Shoot();
//this->~Shooting_Bullets = copy.~Shooting_Bullets();
}
void Shooting_Bullets :: Shoot()
{
Object = BulletObjects; // Sets the specific object range
while (dbObjectExist(Object)) Object++; // Looks for an open slot
dbMakeObjectSphere(Object,2); // This makes the bullet
//dbLoadObject
dbPositionObject(Object, dbCameraPositionX(), dbCameraPositionY(), dbCameraPositionZ()); //Sets the Position
dbSetObjectToCameraOrientation (Object); //Sets the orientation
Exist = true; // Now it exists
Life = BulletLife; //Sets its life Span
}
void Shooting_Bullets :: Kill() // Destroys the bullet
{
dbDeleteObject(Object); //Delete the object
Exist = false; // Now it no longer exists
}
void Shooting_Bullets :: Run() // The Bullet's Run code
{
SC_Start();
//int Zombe_one_Life = 5;
if (Exist == true) // It wil only run if it exists
{
Life--; // Life Span Timer
if (Life <= 0) Kill(); // Destroys it when life is over
dbMoveObject(Object, BulletSpeed); // Moves it at the traveling speed
int bullet_collding;
//bullet_collding = dbObjectCollision(Object,50);
//int Collide = bullet_collding; // Checks if it hits anything
//if (Collide > HitObjects)
int Collide = dbObjectCollision(Object,50);
if (Collide > HitObjects)
{
Kill(); // Destroys it when it hits a wall
}
SC_SetupObject(Object,0,2);
//if(Collide>0)
//{
// Zombe_one_Life--;
// dbDeleteObject(51);
// dbPositionObject(51,0,0,0);
// //dbPlayObject(51,0,50);
// Kill();
//}
}
}
int ReloadTimer; // This is the timer alowing the player to shoot
int CurrentBullet; // This is the bullet cycle
Shooting_Bullets Bullet[MaxBullets];// Makes the actual bullet array
void RunBullets() // This will run all the bullets
{
ReloadTimer--; // Counts down the player usage timer
for (int runner = 0; runner < MaxBullets; runner++)
{
Bullet[runner].Run();
}
}
void ShootBullet()
{
if (ReloadTimer <=0)
{
if (CurrentBullet >= MaxBullets) CurrentBullet = 0; // Makes sure that we stay in the cycle
Bullet[CurrentBullet].Shoot(); //Shoots it
CurrentBullet++; //Next Bullet
ReloadTimer = ShootDelay; // Resets Timer
}
}
But it works in the comiler just fine sooo wth, I need to run my project throught an .exe file or am screwed, and all that hard work I put into it, would be stopped for something that poped out of now here.