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.

Dark GDK / Sprite don't work

Author
Message
Discan
15
Years of Service
User Offline
Joined: 5th Aug 2009
Location:
Posted: 10th Aug 2009 18:04
Coordinates are ok backdrop works ( if I enable it ) it scrolls just fine but player does not show ? Source included.

Attachments

Login to view attachments
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 10th Aug 2009 18:29
You do know, of course, that sending a solution file isn't going to give us the source?

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
Discan
15
Years of Service
User Offline
Joined: 5th Aug 2009
Location:
Posted: 10th Aug 2009 19:17
realized it after thread was sent for approval couldn't modify anything .. will post source here

CPP Files:

Main

Player

Backdrop

Input


HEADER Files:

Main

Player

Backdrop

Input


And if anyone wants to download the FULL source + sprite and backdrop image go to http://filebeam.com/76847424aacf60deafa3074c1eea5eaf .
Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 10th Aug 2009 19:22
haha xD

Brillig
16
Years of Service
User Offline
Joined: 19th May 2008
Location:
Posted: 11th Aug 2009 00:46
I made the following edits:

Main.cpp - only need to run setup (as in LoadImage) once per object



Player.cpp (mostly just some style issues like using dbScreenWidth())



And finally Input.cpp, because I didn't see your scancodes on my keyboard:


I also clobbered your debug directory and rebuilt from scratch. With all these changes, I saw a ship appear at the top right of the screen and I could move it back and forth with left and right arrows.
Discan
15
Years of Service
User Offline
Joined: 5th Aug 2009
Location:
Posted: 11th Aug 2009 11:43
Unfortunately it's same problem and I really don't know how you get it to work when it's obvious we have the same code...here is what I see:

\


It's confusing..does anyone have an idea ?
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 11th Aug 2009 13:33
Is your media in the right place ?

If you are running from Visual Studio, you want your media to be relevant in relation to your project's root folder...so:

\<Project Root>\Assets\ship_anim.png

If you are running the EXE outside of visual studio, your media needs to be relative to the actual EXE itself.. so

\<Folder with EXE inside>\Assets\ship_anim.png

If it ain't broke.... DONT FIX IT !!!
Discan
15
Years of Service
User Offline
Joined: 5th Aug 2009
Location:
Posted: 11th Aug 2009 15:21
I've tried both running from VS and from the EXE outside but same result..I could see the backdrop scrolling program reacting when I press space but no player.
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 11th Aug 2009 15:47
Yes, but did you check if the media(the actual image file) is where it is meant to be ?

If the image or media isnt there, it wont matter where you run it from it wont show anything.

If it ain't broke.... DONT FIX IT !!!
Discan
15
Years of Service
User Offline
Joined: 5th Aug 2009
Location:
Posted: 11th Aug 2009 16:53
Yes it's right next to the backdrop one ..
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 11th Aug 2009 18:58 Edited at: 11th Aug 2009 18:59
BackdropUpdate(); could be the problem, you havent listed that function so I cant say for certain, but it could be that you are overwriting your sprite with the backdrop...

If thats the case then the sprite wont be drawn until you tell it to draw itself ontop of anything else.. try setting the sprite's priority level so its the last thing drawn to the screen, see if that helps..

Have a look through DarkSDKSprites.h and you shuld see some commands that might be useful

EDIT : sorry missed the backdrop listing up a little further, I think sprite priority might be your problem, if your backdrop is a sprite also, then you could be overwriting your ship sprite with the backdrop, sprite priorities should solve that for you, or changing the order that you draw them... make sure you call the function that draws the ship last..

If it ain't broke.... DONT FIX IT !!!
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 11th Aug 2009 21:22
if dbCreateAnimatedSprite() has a return value check that it might be failing in which case your image doesn't exist

New Site! Check it out \/
Discan
15
Years of Service
User Offline
Joined: 5th Aug 2009
Location:
Posted: 11th Aug 2009 22:17
Already tried priority
in Player.cpp, also tried changing the values and the backdrop is a .png an image.

Caleb I will try it tommorow..but it's weird...it works fine for
Brillig but it won't work for me ... Sad..

Login to post a reply

Server time is: 2024-11-20 17:27:55
Your offset time is: 2024-11-20 17:27:55