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.

2D All the way! / Bob does not exist??

Author
Message
palex3
20
Years of Service
User Offline
Joined: 15th Dec 2004
Location:
Posted: 18th Jan 2005 09:36
I'm doing a space invaders-type game... Whenever I check for collision, I get a "Bob does not exist" message and the program ends...I just have one ship and one alien for now... Source code included...
pizzaman
21
Years of Service
User Offline
Joined: 18th Feb 2004
Location: Gateshead, UK
Posted: 18th Jan 2005 10:32
The problem is your checking for a sprite collision between sprites 2 and 3, yet sprite 2 is not created until you press the space bar, thats why you get the error.

Your code should be (note I've cleaned it up a bit)



or instead of checking if the sprite exists you could create it before hand like so



palex3
20
Years of Service
User Offline
Joined: 15th Dec 2004
Location:
Posted: 18th Jan 2005 23:30
thanks, I don't get the error message, but the bullet still goes right through...
The Game Programmer
20
Years of Service
User Offline
Joined: 4th Dec 2004
Location: Sitting, and waiting, and staring, and..
Posted: 19th Jan 2005 03:40
Hi, I'm also making a space shooter thing. I'm basing mine off the tutorial stickied in the 2d section, you're answer might be in the code there, take a look, and if you have any questions just email or IM me and I'll try to help. I'm probably having the same basic problems that you are. I posted in the newcomers forum if you want to look, including all my code and media.

Well, I'm trying aren't I.....

When Life gives you lemons make orange juice. Then sit back and wonder how it was done.
pizzaman
21
Years of Service
User Offline
Joined: 18th Feb 2004
Location: Gateshead, UK
Posted: 19th Jan 2005 09:02
The problem is when you fire the bullet it goes into its own loop, which sends the bullet across the screen, but you not checking for any collision.

Try this, examine it closely, and make sure you know what each part does, before you continue to work on this.



palex3
20
Years of Service
User Offline
Joined: 15th Dec 2004
Location:
Posted: 20th Jan 2005 03:20
ok, I got it this time...thaks a lot, that cleared up a lot of stuff!

Login to post a reply

Server time is: 2025-05-17 09:37:47
Your offset time is: 2025-05-17 09:37:47