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.

DarkBASIC Discussion / i need help with sprite collisions

Author
Message
The Nerd
22
Years of Service
User Offline
Joined: 5th Jun 2004
Location: Denmark
Posted: 16th Oct 2004 21:46
hi

im working on a 2d sprite collision engine..... I call the engine Wempo and it will be realeased on program anounsemt when im done but i have a problem with one of my collisions.

DBC give me an "syntax error. Unrecognised paramenter at line 5"
and i dont know what it is dbc cant understad in that line!?

here is the code:


i will be glad if you could give me some help



The Nerd

If you need a beginner guide to game programming then visit my thread at : http://forum.thegamecreators.com/?m=forum_view&t=40857&b=7
The Nerd
22
Years of Service
User Offline
Joined: 5th Jun 2004
Location: Denmark
Posted: 16th Oct 2004 22:56
please is there anyone ho wanna help?



The Nerd

If you need a beginner guide to game programming then visit my thread at : http://forum.thegamecreators.com/?m=forum_view&t=40857&b=7
The Nerd
22
Years of Service
User Offline
Joined: 5th Jun 2004
Location: Denmark
Posted: 17th Oct 2004 01:14
why wont you guys help me?

If you need a beginner guide to game programming then visit my thread at : http://forum.thegamecreators.com/?m=forum_view&t=40857&b=7
The Nerd
22
Years of Service
User Offline
Joined: 5th Jun 2004
Location: Denmark
Posted: 17th Oct 2004 04:22
PLEASE I NEED HELP!

If you need a beginner guide to game programming then visit my thread at : http://forum.thegamecreators.com/?m=forum_view&t=40857&b=7
EddieB
21
Years of Service
User Offline
Joined: 29th Sep 2004
Location: United Kingdom
Posted: 17th Oct 2004 05:15
Try the edit button.

200GB HARD DRIVE 1GB RAM 256MB GRAPHICS CARD
LordAnki
22
Years of Service
User Offline
Joined: 22nd Apr 2004
Location:
Posted: 17th Oct 2004 05:15
because your double posting.

edit your posts with the edit button. it takes time for people to answer. This actually should go into the Newb Help forum.
Osiris
21
Years of Service
User Offline
Joined: 6th Aug 2004
Location: Robbinsdale, MN
Posted: 17th Oct 2004 06:09 Edited at: 17th Oct 2004 06:09
its because you have an extra comma at the end of the line

anyone can be a hero, but a soldier can be a hero five minuets longer....
Attreid
23
Years of Service
User Offline
Joined: 27th Nov 2002
Location:
Posted: 17th Oct 2004 06:33 Edited at: 17th Oct 2004 06:33
"sprite hit value = sprite collision 1, 2," is wrong. Your variables' name must be one word. Here, you have three of them. That's the first error in your line. When you want to have several words, you can put _ between them

There's also another error. You don't use the sprite collision command as you should. Look at the syntax : "Return Integer=SPRITE COLLISION(Sprite Number, Target Sprite Number)"

So, when you correct the two errors, you have :




"He will come...the voice from the outer world,
bringing the holy war, the Jihad, which will cleanse the Universe and bring us out of darkness."
Osiris
21
Years of Service
User Offline
Joined: 6th Aug 2004
Location: Robbinsdale, MN
Posted: 17th Oct 2004 06:37
yeah that too

anyone can be a hero, but a soldier can be a hero five minuets longer....
The Nerd
22
Years of Service
User Offline
Joined: 5th Jun 2004
Location: Denmark
Posted: 17th Oct 2004 06:49
thanks

If you need a beginner guide to game programming then visit my thread at : http://forum.thegamecreators.com/?m=forum_view&t=40857&b=7
The Nerd
22
Years of Service
User Offline
Joined: 5th Jun 2004
Location: Denmark
Posted: 17th Oct 2004 06:56
okay now i have a new problem.

when the sprite you control hit the other sprite it wont work

please some help me.

this is my code:



the guys ho help me with this will be added to credits.

and Attreid you will also be added to the credits


hope someone can help


The Nerd

If you need a beginner guide to game programming then visit my thread at : http://forum.thegamecreators.com/?m=forum_view&t=40857&b=7
The Nerd
22
Years of Service
User Offline
Joined: 5th Jun 2004
Location: Denmark
Posted: 17th Oct 2004 08:17
come on please help me



The Nerd

If you need a beginner guide to game programming then visit my thread at : http://forum.thegamecreators.com/?m=forum_view&t=40857&b=7
Dot Merix
22
Years of Service
User Offline
Joined: 15th Oct 2003
Location: Canada
Posted: 17th Oct 2004 08:30 Edited at: 17th Oct 2004 08:35
try something like this.. The way you had it set before, it wouldnt tell you when it's colliding or anything..



SPRITE HIT
This command will return a one if the specified sprite has impacted against the target sprite specified. If a
target sprite has not been specified and a value of zero has been used, this command will return the sprite
number of any sprite impacting against it. The parameters should be specified using integer values.

SYNTAX
Return Integer=SPRITE HIT(Sprite Number, Target Sprite Number)

SPRITE COLLISION
This command will return a one if the specified sprite is overlapping the target sprite specified. If a target
sprite has not been specified and a value of zero has been used, this command will return the sprite
number of any sprite overlapping it. The parameters should be specified using integer values.

SYNTAX
Return Integer=SPRITE COLLISION(Sprite Number, Target Sprite Number)

sprite hit is impact.. collision is if it is overlapping the other sprite.

Also, you explained your problem extremely terribly..
Quote: "when the sprite you control hit the other sprite it wont work "


Next time specify what it is that isnt working. Ie.. it wont tell you when the sprites have collided, it wont do a specific action etc.



WindowsXP Home(Service pack 2), Athlon XP 2400+(2.1Ghz), 1GIG Ram, Ati Radeon 9800Pro 128MB.
The Nerd
22
Years of Service
User Offline
Joined: 5th Jun 2004
Location: Denmark
Posted: 17th Oct 2004 08:42
thanks Merix

you will now be added to the credits

and yet a thank you



The Nerd

If you need a beginner guide to game programming then visit my thread at : http://forum.thegamecreators.com/?m=forum_view&t=40857&b=7
Dot Merix
22
Years of Service
User Offline
Joined: 15th Oct 2003
Location: Canada
Posted: 17th Oct 2004 08:44
Not a problem



WindowsXP Home(Service pack 2), Athlon XP 2400+(2.1Ghz), 1GIG Ram, Ati Radeon 9800Pro 128MB.
The Nerd
22
Years of Service
User Offline
Joined: 5th Jun 2004
Location: Denmark
Posted: 17th Oct 2004 08:46 Edited at: 17th Oct 2004 08:55
the code works fine and i can run the program. but when the two sprites collide there is nothing happen.


The Nerd

If you need a beginner guide to game programming then visit my thread at : http://forum.thegamecreators.com/?m=forum_view&t=40857&b=7

Login to post a reply

Server time is: 2026-07-18 12:07:57
Your offset time is: 2026-07-18 12:07:57