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 Help! What command do I use?

Author
Message
Gilden
20
Years of Service
User Offline
Joined: 10th Aug 2004
Location:
Posted: 15th Apr 2005 09:12
I have a graphic sprite arrow button that I want to place in several places on the screen. How do you do that?

The sprite command places it on the screen. Then when I use the sprite command again it doesn't make a new one. Just moves the old sprite to a different location. I want to have several copies of my sprite on the screen without needing to have several graphic files uploaded.

Gilden
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 15th Apr 2005 09:20 Edited at: 15th Apr 2005 09:21
Just load 1 image and apply it to several sprites



OR if you don't need to use collision checking on the sprites use the paste sprite command.



Gilden
20
Years of Service
User Offline
Joined: 10th Aug 2004
Location:
Posted: 16th Apr 2005 03:13
Thanks I will give it a try


Gilden
Gilden
20
Years of Service
User Offline
Joined: 10th Aug 2004
Location:
Posted: 16th Apr 2005 05:15
I've tried the code and it doesn't seem to work.

This is a sample of the code I am using:

do

gosub main_program

loop

main_program:

load image "image.bmp", 1
sprite 1, 0, 0, 1
hide sprite 1


if (sprite hit(g_SELECT01,image,)=1 and returnkey()=1)
wait 150
play sound 2
paste sprite 1, 20, 20
paste sprite 1, 50, 50
paste sprite 1, 80, 80

endif

Its exactly like you told me. I don't know why you gave me the hide sprite command though. It's just makes my picture vanish. When I use the paste sprite command my image is still in its original spot and does not appear any where else.

Why is this so difficult?

Gilden
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 16th Apr 2005 07:24
Try working with this.



In Space No One can Hear You Scream! (When your comm Line is cut?)
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 16th Apr 2005 07:29
Take this :



out of your main loop. You are reloading the image over and over again.

I will have a closer look when I get home.

Login to post a reply

Server time is: 2024-09-23 17:30:49
Your offset time is: 2024-09-23 17:30:49