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 Professional Discussion / Help with Bullet + Enemy = Bloodsplatter code (2D)

Author
Message
Alexand3rS DJSubzone
16
Years of Service
User Offline
Joined: 31st Jul 2009
Location: In a club.
Posted: 16th Nov 2009 04:26
Hi, it's me again. I hope I did the right thing by making a separate post for this problem.

Here is my bullet code:



(it's actually not mine I siphoned it off of the CodeBase and forgot who to give credit to, please tell me if this is yours!)

Here's my problem: I'm trying to add the function



to my code somewhere in that goSub up there, but I'm unsure what to put in the ?? spot in that string right above. It needs to be the bullet, but I don't know which sprite IS the bullet. If I put 10 I get a "sprite doesn't exist" error, if I put b+10 the bloodsplatter doesn't show up unless I'm standing right next to the enemy.

Please help!

Regards, Alexand3rS.

http://DoLoop.page.tl
http://www.youtube.com/Alexand3rS
Alexand3rS DJSubzone
16
Years of Service
User Offline
Joined: 31st Jul 2009
Location: In a club.
Posted: 20th Nov 2009 02:28
*Bump* Please Help!!

http://DoLoop.page.tl
http://www.youtube.com/Alexand3rS
Alexand3rS DJSubzone
16
Years of Service
User Offline
Joined: 31st Jul 2009
Location: In a club.
Posted: 26th Nov 2009 00:09
Can somebody please help? My game has come to a standstill because of this problem!!

http://DoLoop.page.tl
http://www.youtube.com/Alexand3rS
Digger412
18
Years of Service
User Offline
Joined: 12th Jun 2007
Location:
Posted: 26th Nov 2009 00:25 Edited at: 26th Nov 2009 00:29
Okay, the first parameter in the sprite collision command is the sprite being overlapped. The second number is the sprite doing the overlapping. For instance, if I had sprite collision(1,2), I would be asking 'is sprite number 2 overlapping sprite number 1?', and if it was then the result would equal 1. If you had sprite collision(1,0), you would be asking 'what sprite is overlapping sprite number 1?', and the result would be any sprite overlapping sprite number 1. Hope that helps.

EDIT: Oh wait, you were looking for which sprite was the bullet. I'll re-read the post, sorry.

EDIT 2: Wouldn't the bullet sprite number be MaxNumOfBullets? After all, if you're cycling through the bullets, each one has to have a sprite, correct?
Alexand3rS DJSubzone
16
Years of Service
User Offline
Joined: 31st Jul 2009
Location: In a club.
Posted: 26th Nov 2009 05:22
Hey thanks for replying! (Finally)

Nope, MaxNumOfBullets isn't the bullet sprite number. MaxNumOfBullets is a variable I can change in my code to change the limit of how many bullets are alive at one time.

(*I think*)

http://DoLoop.page.tl
http://www.youtube.com/Alexand3rS
Hockeykid
DBPro Tool Maker
18
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 26th Nov 2009 05:28


That should work but to enhance it i will need to know your blood splat numbers and all enemy numbers(they should be in numerical order)

Alexand3rS DJSubzone
16
Years of Service
User Offline
Joined: 31st Jul 2009
Location: In a club.
Posted: 27th Nov 2009 07:45
Ummmm Hockeykid, did you change anything about that code up there?

http://DoLoop.page.tl
http://www.youtube.com/Alexand3rS
Hockeykid
DBPro Tool Maker
18
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 27th Nov 2009 07:47
Quote: "Ummmm Hockeykid, did you change anything about that code up there?"


Yes I added in if the sprite collides with another then position the blood at the enemy position

Alexand3rS DJSubzone
16
Years of Service
User Offline
Joined: 31st Jul 2009
Location: In a club.
Posted: 3rd Dec 2009 06:23 Edited at: 3rd Dec 2009 06:25
Quote: "Yes I added in if the sprite collides with another then position the blood at the enemy position
"


*Facepalm*

Thanks, but we're trying to figure out what to put IN the sprite collision(i,ii) spot! >.<

http://DoLoop.page.tl
http://www.youtube.com/Alexand3rS

Login to post a reply

Server time is: 2026-06-11 04:00:59
Your offset time is: 2026-06-11 04:00:59