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 / animated bullet has white box when fired

Author
Message
sskethan
16
Years of Service
User Offline
Joined: 20th Sep 2008
Location: Oshawa, ON. Canada
Posted: 8th Dec 2011 15:37
Ok... So the problem im having is when i fire the bullet the first one fires perfect, but every other bullet after fires a white box. If i fire a single image of an arrow the code works fine each arrow fires. Here is the code im using and some screen shots of the problem.

Attachments

Login to view attachments
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 8th Dec 2011 16:07
This is just a wild guess, but could it be that you have to reset the animation before playing it a second time? Something like set sprite frame <spr>,0

TheComet

Darkzombies
13
Years of Service
User Offline
Joined: 25th Dec 2010
Location: In multiple tabs, most likely youtube.
Posted: 8th Dec 2011 17:09
What color is it? If it is black then dbpro may be deleting that, try setting the colorkey to white then loading the image.

-------------------------------------------------------------
sskethan
16
Years of Service
User Offline
Joined: 20th Sep 2008
Location: Oshawa, ON. Canada
Posted: 9th Dec 2011 01:39
TheComet
I'm sure that is the case but im not sure how to do it. I have tried it but it doesn't work. I was able to make the white box go away but still the first bullet works with animation but then the rest of the bullets are of the entire image (all 8 frames)

Darkzombie
Do you mean the color of the image background. The file is a .png file with a transparent background.
Darkzombies
13
Years of Service
User Offline
Joined: 25th Dec 2010
Location: In multiple tabs, most likely youtube.
Posted: 9th Dec 2011 01:48
@sskethan That doesn't matter, dbpro has a colorkey that it deletes when loading an image, by default that is black, so despite it being a png, if its black change it using set colorkey. Though that may not even be the problem.

-------------------------------------------------------------
sskethan
16
Years of Service
User Offline
Joined: 20th Sep 2008
Location: Oshawa, ON. Canada
Posted: 9th Dec 2011 02:42
I set the colorkey but it didn't change anything, I still get the same results
Hodgey
15
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 9th Dec 2011 09:21 Edited at: 9th Dec 2011 09:26
Quote: "That doesn't matter, dbpro has a colorkey that it deletes when loading an image, by default that is black, so despite it being a png, if its black change it using set colorkey. Though that may not even be the problem."

Ummm...I think it does. From the documentation :
Quote: "Be aware that setting the color key for the purpose of transparency will not work on images based on the PNG, TGA and DDS file format "

Actually just re-reading the first post, I think this is irrelevant. From what I've read it is firing a white box instead of the desired image, not an image inside a white box.

EricB
13
Years of Service
User Offline
Joined: 3rd Nov 2011
Location:
Posted: 9th Dec 2011 13:20
Just a thought are you using the same animated sprite for all shots? Try to the clone sprite before you shoot and use the cloned sprite as the animated shot.

I believe the problem here is DBP does not allow the same sprite to exist in two locations simultaneously.
MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 9th Dec 2011 17:28
Maybe use memblocks? Just wild guess... but if an image is loaded I am sure it can be instanced... just thinking...

sskethan
16
Years of Service
User Offline
Joined: 20th Sep 2008
Location: Oshawa, ON. Canada
Posted: 9th Dec 2011 23:12
I have been trying to use clone sprite. but everything i try i keep getting the message sprite already exists. Can you please show an example of how clone works.
MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 9th Dec 2011 23:43
Type either clone object or instance object in dbpro code window click in the middle of the word and press the f1 key...

Hodgey
15
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 10th Dec 2011 00:47
I think I may have found the problem. You are only creating 1 animated sprite while the rest are just normal, unanimated sprites. So try this:


sskethan
16
Years of Service
User Offline
Joined: 20th Sep 2008
Location: Oshawa, ON. Canada
Posted: 10th Dec 2011 01:19
Hodgey
yes. That works perfect. Thank you so much.

MrValentine
sorry I was using the help files on how to use clone sprite but it does not give examples on using it with animated sprites. Thanks for your suggestion.

Thank you everyone for all your help. The game is really coming along.

Login to post a reply

Server time is: 2024-11-25 16:13:33
Your offset time is: 2024-11-25 16:13:33