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 / Animated Sprite Question(/problem?)

Author
Message
Xarcolt
18
Years of Service
User Offline
Joined: 29th Sep 2007
Location:
Posted: 25th Mar 2010 03:34
Hey,
I'm having difficulty creating a simple animated sprite. Here's the code I used.



-The 'startmenu.bmp' file is 3200,480
-The across value of the first animated sprite is 5 (5x640=3200)
-The down value is 1 (1x480=480)
-The display mode is a full screen 640x480x32
-The sprite should be taking the entire screen
-The black color being the image's own background is rgb 1,1,1

I thought it should at least work a little, but i just get a blue screen and nothing else. What am I missing?
NightX
17
Years of Service
User Offline
Joined: 3rd Apr 2009
Location: Australia, QueensLand
Posted: 25th Mar 2010 11:18 Edited at: 25th Mar 2010 13:36
Try -> play sprite just before your loop?



Xarcolt
18
Years of Service
User Offline
Joined: 29th Sep 2007
Location:
Posted: 25th Mar 2010 23:43
Thanks for the help, but the 'play sprite' code line says it has an illegal image number for some reason o-O.
WickedX
17
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 26th Mar 2010 02:00
The start frame need to be 1.
play sprite 1,1,6,10
Xarcolt
18
Years of Service
User Offline
Joined: 29th Sep 2007
Location:
Posted: 26th Mar 2010 04:56
Back to the blue-screen-only problem.
WickedX
17
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 26th Mar 2010 05:21
If I put this together right it should work.

Rich Dersheimer
AGK Developer
17
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 26th Mar 2010 21:35
First, why are you using SET SPRITE FRAME? Do you have 5 menu screens, and are using sprites to display them? PASTE SPRITE might work better. Or just paste your big image on the screen, offsetting it to the left in 640 pixel increments.

Next, PLAY SPRITE must be inside the loop for it to have any effect on animating a sprite. Also, you can't use frame zero, the help file example is bugged. But, if you just want to show one of the 5 sprite frames at a time, don't play it, paste it.

Now, I made my own "startmenu.bmp" and your code from the first post above runs just fine, I don't see a blue background, I see the third sprite on my sprite sheet.

However, it also works fine like this...



See the difference? Once you have a sprite on the screen, you don't need to keep putting it there in the loop.

If that is not working for you, the problem may lie elsewhere. Is there more code? Does it work without the SET SPRITE FRAME?

Xarcolt
18
Years of Service
User Offline
Joined: 29th Sep 2007
Location:
Posted: 27th Mar 2010 02:08
I'm sorry. Both of your snippets result in black and blue screens respectively. Is it possible that it's a free version limitation?
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 27th Mar 2010 02:33 Edited at: 27th Mar 2010 02:38
Quote: "Both of your snippets result in black and blue screens respectively"


Have you prepared any image to test ?....

You have to create a image and divide it...let say 3 by 3 and get 9 frames from a prepared image...so you will have to paint those frames to get this animate sprite.Here I show you an example.

Let us know if it works to you...good luck.

cheers.

I'm not a grumpy grandpa
Indicium
18
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 27th Mar 2010 02:39
Quote: ". Is it possible that it's a free version limitation?"


There is NO limitation to the free version bar the ads and the liscence.

Windows 7 32-Bit Home Premium Intel Pentium Dual-Core @ 1.46Ghz 2038mb RAM
Rich Dersheimer
AGK Developer
17
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 27th Mar 2010 03:58
Can you simply load the image and then paste it at 0,0? That would tell you if you have valid path to a good image.

Other than that I'm stumped.

Xarcolt
18
Years of Service
User Offline
Joined: 29th Sep 2007
Location:
Posted: 27th Mar 2010 06:23
The example and the paste image advice result in having a blue screen.. kind of a bummer. Anyway, thanks for trying to help.
Rich Dersheimer
AGK Developer
17
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 27th Mar 2010 09:37
Well, if you will zip up your project, including the .bmp file, and attach it to a message here, we can dig into the problem. I'm very curious as to why you can't load and display a sprite.

Xarcolt
18
Years of Service
User Offline
Joined: 29th Sep 2007
Location:
Posted: 27th Mar 2010 19:15
OH!! I figured out the problem! Sorry for wasting your time. The problem was I forgot to 'run as administrator' (vista apparently requires that). So um, thanks for trying to help, I'll just get back to making the game.
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 27th Mar 2010 19:29
Quote: "The problem was I forgot to 'run as administrator"

you don´t have to run as administrator
Have you solved your problem already? ....we don´t want to be tiresome, so you can go back to the grind



cheers!

I'm not a grumpy grandpa
Indicium
18
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 28th Mar 2010 17:28
Quote: "you don´t have to run as administrator "


ermmm... yeah you do...

Windows 7 32-Bit Home Premium Intel Pentium Dual-Core @ 1.46Ghz 2038mb RAM

Login to post a reply

Server time is: 2026-07-26 21:11:53
Your offset time is: 2026-07-26 21:11:53