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 / Attempting to make multiple copies of sprites.

Author
Message
MuseEffigy
14
Years of Service
User Offline
Joined: 18th Aug 2010
Location:
Posted: 18th Aug 2010 11:19
Hi there, first time poster here.

I currently have a firing mechanism in my game whereby a block expands slowly in the direction the player is facing and pushes the enemies in the opposite direction. I have a sprite that I would like to use to make it look like a beam blast. What I want to do is to have the sprite copy itself along the path of the "beam" so as to create a contiguous line of sprites when the user fires. Is this possible, or am I just going about this the wrong way? My other option is to make it look instant by simply extending the sprite with image editing, but it looks very messy.

Thanks!
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 18th Aug 2010 18:48
It's easier to use STRETCH SPRITE. The only bad thing is if the image isn't really designed for it it'll look bad.



LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 18th Aug 2010 19:11 Edited at: 18th Aug 2010 19:11
I also think that STRETCH SPRITE is the way to go, but you will have to reposition the sprite as it stretches.

So many games to code.......so little time.
MuseEffigy
14
Years of Service
User Offline
Joined: 18th Aug 2010
Location:
Posted: 19th Aug 2010 02:20
Thanks a lot! Stretching the sprite worked out pretty well, although there are now a few collision issues to work out. Thanks again!

-S
Neuro Fuzzy
17
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 19th Aug 2010 07:55
Quote: "I also think that STRETCH SPRITE is the way to go, but you will have to reposition the sprite as it stretches."

not if you adjust the sprite's center offset, right?
(i say "right" because I'm only like 75% sure and don't want to look it up)


Is't life, I ask, is't even prudence, to bore thyself and bore thy students?
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 19th Aug 2010 09:43
It shouldn't normally because it stretches on the right and/or bottom of the sprite. The top and left of the sprite remain the same (where the sprites x and y coordinates are).




If you do use OFFSET SPRITE it could stretch in any direction but because the center of the sprite is the offset it never changes coordinates either.



Neuro Fuzzy
17
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 19th Aug 2010 10:23
right, so if you "offset sprite" where you want it you shouldn't have to change the position to compensate for scaling


Is't life, I ask, is't even prudence, to bore thyself and bore thy students?
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 19th Aug 2010 17:49
It seems that if you have an image with black (transparent) space on the sides of it, that the stretch doesn't work right and it would have to be repositioned. By grabbing an image that has no black space on the side, it works fine.

So many games to code.......so little time.

Login to post a reply

Server time is: 2024-11-24 12:07:21
Your offset time is: 2024-11-24 12:07:21