Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Help With Tower D Game

Author
Message
Satchmo
19
Years of Service
User Offline
Joined: 29th May 2005
Location:
Posted: 7th Nov 2009 08:03 Edited at: 7th Nov 2009 08:03
Okay so I'm just having a problem that I can't figure out lol, maybe one of you will be able to find it.

Basically I've begun writing a tower d game, and I'm beginning to get most of the basics down(projectiles, enemies, towers etc.) I've gotten to the point where I can make towers that *should* fire projectiles, but I can't get the thing to fire.

The code is set up to check through a list of 100 projectiles and find a unused one to fire. Then it checks to see if there is an enemy within the tower range(I KNOW this isn't the problem, I've checked and it always confirms that it is within range.) So if it finds an enemy within the tower range and there is a projectile open, it will tell the program that it needs to be spawned along with the appropriate data(Which tower to spawn at and which enemy to fire at.) Though I just cant seem to get it firing.

Here is the code(with comments.)



Satchmo
19
Years of Service
User Offline
Joined: 29th May 2005
Location:
Posted: 7th Nov 2009 19:21
Well, I fixed THAT problem, but now it tells me that the objects I'm trying to create already exist(they shouldn't I check in the code to make sure it doesn't spawn a projectile that already exists)

The code below needs no media to run:


IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 8th Nov 2009 19:18
You have the parameters the wrong way around for your INSTANCE OBJECT command.

Neuro Fuzzy
17
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 9th Nov 2009 02:19
lol, didn't you have the exact same problem posted in the DBPro board?
Satchmo
19
Years of Service
User Offline
Joined: 29th May 2005
Location:
Posted: 9th Nov 2009 06:56
Yup, I was a little anxious to figure it out lol, won't happen again.

Tom0001
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location:
Posted: 16th Nov 2009 00:45
Just a small note, though...to solve your error, you could try sticking 'IF NOT OBJECT EXIST(<number>' in there. Like, I know it's usually only a temporary fix, and doesn't really provide a real solution to your problem, but yeah -- it may end up resolving the problem altogether.

Also, I'm not sure how big you intend the map to be but...I suggest a good many more than 100 possible projectiles.

Login to post a reply

Server time is: 2024-09-28 12:19:41
Your offset time is: 2024-09-28 12:19:41