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.

2D All the way! / Pasting the same sprite over and over

Author
Message
Jeku
Moderator
20
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Vancouver, British Columbia, Canada
Posted: 28th Jan 2004 00:20
Hey guys,

Is there any drawback to pasting the same sprite over and over in different coordinates on the screen, or should I use a separate sprite object for every location?

In my game I want the same wall sprite several times over on the screen and I'm thinking of doing something like this:

pseudo-code
{
paste sprite sprWall01, 0, 0
paste sprite sprWall01, 100, 0
paste sprite sprWall01, 0, 100
paste sprite sprWall01, 100, 100
etc.
}

I'm afraid that maybe it may limit me in the future. Do you think it will be faster on older computers or slower if I use a separate sprite object for each wall tile location? For ex:

pseudo-code
{
paste sprite sprWall01, 0, 0
paste sprite sprWall02, 100, 0
paste sprite sprWall03, 0, 100
paste sprite sprWall04, 100, 100
etc.
}

Ancient Chinese proverb: Man who runs behind car gets exhausted.

http://www.automatongames.com/
indi
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 28th Jan 2004 03:33 Edited at: 28th Jan 2004 03:38
I dont see a problem with it. In essence it should save texture memory or image memory or location handling memory. affecting a wall tho with say a splatter will affect them all since they are all inherited from the one media location.





CloseToPerfect
21
Years of Service
User Offline
Joined: 20th Dec 2002
Location: United States
Posted: 28th Jan 2004 06:17
just realize that paste sprite is not a sprite, it is only the image the sprite uses, so knowing this, sprite collsion will not work with paste sprite. If you need the use the sprite collision commands you'll have to use multiple sprite commands to place them.

RGT may be gone but the best DBP forum is still alive and kicking, check it out.
http://www.dannywartnaby.co.uk/rgt/
Jeku
Moderator
20
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Vancouver, British Columbia, Canada
Posted: 28th Jan 2004 08:30
Thanks for the tips, guys. My 2D level editor is getting along great now with simply pasting the sprites over and over again. There's no hitch in the speed or anything. Since my game is tile-based, collision can be worked out from my 2-dimensional array instead of using the built in sprite collision.

I've also figured out a cool way to simulate a 3D camera using offsets for movement and scaling the entire screen for zooming in and out! As I only have experience with 3D games, this 2D stuff is surprisingly fun and almost, dare I say it, better

- Jeku

Ancient Chinese proverb: Man who runs behind car gets exhausted.

http://www.automatongames.com/
the_winch
21
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 28th Jan 2004 18:29
If you arn't using sprites for collision or any of the sprite appearance commands you could use PASTE IMAGE instead and not have any sprites.

In dbpro sprites are 3d so when you create a sprite all the 3d stuff is started, it might load fractionally quicker without sprites and might result in a smaller exe. Proberly not worth the effort of changeing the code over though.
Jeku
Moderator
20
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Vancouver, British Columbia, Canada
Posted: 28th Jan 2004 20:53
Are you serious? I wanted to avoid 3D so this game would run smoothly on my laptop. Hmmm... well, I'm using scaling and rotating of my sprites, so I don't think that's supported with images.

Thanks for the tip, though, I'll have to remember it for next time

Ancient Chinese proverb: Man who runs behind car gets exhausted.

http://www.automatongames.com/
indi
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 4th Feb 2004 05:30
its the way direct x 8+ handles all 2d stuff as a 3d billboard of sorts.


Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 6th Feb 2004 02:56
dbp has a demo using memblocks that pastes the same sprite like a 1000 times.

"eureka" - Archimedes
Jeku
Moderator
20
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Vancouver, British Columbia, Canada
Posted: 6th Feb 2004 03:56
Hmmm I'll check the demo out. My engine needs to track and refresh every sprite individually because I'm emulating a 3D camera with rotating, zooming, and panning. Anyways, it works now, so the question was answered

[href][/href]
http://www.automatongames.com/
Ancient Chinese proverb: Man who runs behind car gets exhausted.
UnderLord
20
Years of Service
User Offline
Joined: 2nd Aug 2003
Location:
Posted: 8th Feb 2004 01:19
2d games are hella fun to make and i think interplay knows it =P

The search continues.
glint
20
Years of Service
User Offline
Joined: 9th Feb 2004
Location: the Synth
Posted: 12th Feb 2004 04:18
I have a question : How are you changing panning, zooming, etc, in your game? I am trying to figure out how to do similar things, since I am making a 360-direction scrolling game.
UnderLord
20
Years of Service
User Offline
Joined: 2nd Aug 2003
Location:
Posted: 12th Feb 2004 06:02
thats interresting.

The search continues.
glint
20
Years of Service
User Offline
Joined: 9th Feb 2004
Location: the Synth
Posted: 13th Feb 2004 06:11
no, seriously; I don't know how to do this. The manuals and command lists don't really tell me very much here

Login to post a reply

Server time is: 2024-05-13 02:34:18
Your offset time is: 2024-05-13 02:34:18