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 / Cloning Sprites help

Author
Message
Destrugter 1
17
Years of Service
User Offline
Joined: 26th Oct 2006
Location:
Posted: 9th Mar 2008 20:40
Ok, I have searched, and cant find a solution. I am wanting to clone my sprites, and not "paste" them so I can detect collision, but I don't want to use up too many slots with cloned sprites...for example lets say I need 10 grass sprites...I dont want it to be like this:
Quote: "
create sprite 1,1
create sprite 2,2
create sprite 12,12
"


Or is that the only way to do it?

do you love video games a lot ¿¿¿ then comeon down too game zone252 @ http://www.freewebs.com/gamezone252/
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 9th Mar 2008 23:15
You mention you are concerned with using up too many slots? What slots are you talking about?

Also, your quote shows create sprite 1,1 etc., which I assume is simply a typo and you meant clone sprite. However, if you meant clone sprite, then why are the source and destination numbers the same?

If what you are really after is to minimize the amount of code needed to clone multiple sprites, why can't you just use a for-next loop? Perhaps you are after something else.

LB
Destrugter 1
17
Years of Service
User Offline
Joined: 26th Oct 2006
Location:
Posted: 13th Mar 2008 00:37
ok, what I was meaning by "slots" is using too many sprites...ive cloned my sprites from 30 to 5600 about...and now my computer wont load them fast enough (10 minutes and nothing shows up)

do you love video games a lot ¿¿¿ then comeon down too game zone252 @ http://www.freewebs.com/gamezone252/
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 13th Mar 2008 00:52
Wow! 5600 sprites, I'm not surprised you're having a speed issue. What exactly are you doing with all of these sprites? I think the most I have ever used in a game is around 150 and these were very small pieces.

LB
Destrugter 1
17
Years of Service
User Offline
Joined: 26th Oct 2006
Location:
Posted: 13th Mar 2008 01:21
I'm using 32x32 sprites...i cloned them enough to make for if I have to cover the whole screen with them(emergency case) I am making an rpg...so I kinda need quite a few. Also would it speed it up if I put all of my sprites (like house accessories) in one big file instead of a seperate 32x32 bmp for each one?

do you love video games a lot ¿¿¿ then comeon down too game zone252 @ http://www.freewebs.com/gamezone252/
Dabbler
17
Years of Service
User Offline
Joined: 3rd Mar 2007
Location: Minnesota
Posted: 13th Mar 2008 01:44
Code sample?


Whatever...
Destrugter 1
17
Years of Service
User Offline
Joined: 26th Oct 2006
Location:
Posted: 13th Mar 2008 01:48 Edited at: 13th Mar 2008 01:49
It's 600 lines (please don't badger me about using such big notes...it really helps me to see where im going even though I could make them 1 line...this is just easier for me.)



do you love video games a lot ¿¿¿ then comeon down too game zone252 @ http://www.freewebs.com/gamezone252/
Dabbler
17
Years of Service
User Offline
Joined: 3rd Mar 2007
Location: Minnesota
Posted: 13th Mar 2008 02:58
First: I will not badger: if it works for you then its ok.

Second: As others have said: That's a lot of sprites.

Just a couple thoughts: Most of the sprites are landscape images, would it be possible to create each image once and paste them on a background? If the background needs to move, make it a sprite from this larger composit background image?

Hey, I only dabble.


Whatever...
Destrugter 1
17
Years of Service
User Offline
Joined: 26th Oct 2006
Location:
Posted: 13th Mar 2008 03:08 Edited at: 14th Mar 2008 02:25
i need to detect alot of collision between my sprites also im building the inside of houses which i do not want to be just a big rectangle...im actually going to use walls and make rooms

EDIT: Also on top of that I tried pasting sprites before my loop and they don't show up...seems to me like it doesnt even work -_-

do you love video games a lot ¿¿¿ then comeon down too game zone252 @ http://www.freewebs.com/gamezone252/

Login to post a reply

Server time is: 2024-09-27 12:19:42
Your offset time is: 2024-09-27 12:19:42