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 / sprite collision help

Author
Message
cactuar man
17
Years of Service
User Offline
Joined: 17th Aug 2007
Location: Cyberspace
Posted: 18th Aug 2007 08:09
hello,
I am having a lot of trouble with sprite collision collision. I am now working on a pong game in dbp with power ups. when you hit the ball and it collides with a power up you get the power up. The problem is that the ball wont collide with the powerup. I looked it over multiple times and I could'nt find anthing.



I used subroutines and I probably should have used fucntions but I had bad experiences with them in the past. When I run the program the last line for each players phase seems to be in affect.



if someone could please help me it would be greatly appreciated.
Veron
17
Years of Service
User Offline
Joined: 22nd Nov 2006
Location:
Posted: 18th Aug 2007 13:59
Try the SPRITE HIT command.


[center]
Veron
17
Years of Service
User Offline
Joined: 22nd Nov 2006
Location:
Posted: 18th Aug 2007 14:54
True, I only suggested it because I had problems when using OBJECT COLLISION, but it worked when I used OBJECT HIT.


[center]
cactuar man
17
Years of Service
User Offline
Joined: 17th Aug 2007
Location: Cyberspace
Posted: 18th Aug 2007 19:26 Edited at: 18th Aug 2007 21:08
sprite hit dind'nt work.
well here is the whole code.


thanks for all the help so far.
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 18th Aug 2007 21:06 Edited at: 18th Aug 2007 21:10
Quote: "In DBPro, there's no difference between SPRITE COLLISION and SPRITE HIT."


As I've said before, there is. Only a small but subtle difference, but a difference.

Object Hit is a one-off trigger. It only returns a 1 at the point of impact then returns 0 from then on - even if the sprites are still overlapping.

Object Collision on the other hand returns a 1 all the time that the sprites are overlapping.

[Edit] I just re-read the post and realised that it specifically says 'In DBPro' so I can't qualify what I said above until I re-install DBP and test it out myself. It makes no sense for the commands to be any different in DBP to DBC if they both do exactly the same thing!

TDK_Man

TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 18th Aug 2007 21:16
The command names alone infer they should do the same thing.

My mistake in mixing up the Sprite and Object part though.

You would expect the sprite commands to be the equivalent of the object commands.

A bug perhaps?

TDK_Man

TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 18th Aug 2007 21:55
After trying it myself I can confirm that WindowsKiller is correct with respect to Sprite Hit and Sprite Collision not working the same way as Object Hit and Object Collision.

My apologies to him for misreading his post. My comments on Object Hit/Collision were correct - but irrelevant for this particular problem.

The help files say they work the same as the Object equivalents, but as the Sprite Hit command clearly doesn't, it has to be a bug.

What I said above is how it should work but as Windowskiller correctly says, in DBPro they both do the same thing.

I suggest that you use the commands as they were intended to be used (as I outlined above) because if they bug is corrected in an update it may alter the way your program works.

TDK_Man

cactuar man
17
Years of Service
User Offline
Joined: 17th Aug 2007
Location: Cyberspace
Posted: 18th Aug 2007 22:10
Alright, thanks for the clarification. I belive sprite collision would be best for this program. Although i still cant detect the bug in the program.

Login to post a reply

Server time is: 2024-09-27 02:29:22
Your offset time is: 2024-09-27 02:29:22