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! / Combining a checkerboard of sprites into 1....how to?

Author
Message
PowerFang
21
Years of Service
User Offline
Joined: 6th Feb 2004
Location: Australia (But currently in the USA)
Posted: 23rd Apr 2005 09:41
G'day,

I'm changing my game from a turn based into real time and redrawing the screen of 25 * 25 tiles each cycle will kill it. What i was wondering if there was some way to combine these into 1 sprite/bitmap.

There used to be a make bitmap function but it is not supported anymore. How would you suggest i go about it?
zenassem
22
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 23rd Apr 2005 09:50
25 * 25 shouldn't kill it. I have done maps with multiplee layers. Usually my display area is a bit smaller but I guess that all depends on the size of your tiles. But even a tile size of 32 * 32 and multiple layers is no problem. So I redraw a 10*10*5 Layer map. There might be something I am missing here.

~zen


PowerFang
21
Years of Service
User Offline
Joined: 6th Feb 2004
Location: Australia (But currently in the USA)
Posted: 23rd Apr 2005 12:30
i mean i have 25 tiles wide and 25 tiles long

i.e. 625 tiles on the screen and redrawing them each cycle.

Their terrain tiles so once i finish a screen i want to be able to make them into 1 big tile if it will improve performance.
Indigo
22
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United States
Posted: 25th Apr 2005 02:32 Edited at: 25th Apr 2005 02:34
well, if your game screen scrolls, then here is what you can do...

instead of redrawing every map tile every loop, only redraw the ones that are within the screen boundries. there are several ways you can do this, as I have done it many times - and it does improve your game speed.

tilex = int(xoffset/tilesize)+1
tiley = int(yoffset/tilesize)+1

the above equation should give you the grid number x and y for which to start drawing tiles (depending on how you determine your offset variables, you may or may not have to add some absolute value stuff in there), and lets say your screen can only fit 16 tiles across, and 12 down... so then you'd put it in a loop like this...

for y = tiley to tiley+12
for x = tilex to tilex+16
...blah blah...
next x
next y

...but then again - if your screen is constantly containing 25 by 25 tiles without going out of screen borders, then I wrote this whole thing for no good reason.


PS
Hi zen - long time no see. haven't done any pixeling lately have you?

Shoot for the moon. Even if you miss, you'll land amongst the stars.
PowerFang
21
Years of Service
User Offline
Joined: 6th Feb 2004
Location: Australia (But currently in the USA)
Posted: 25th Apr 2005 05:02
yeah each map is 25 tiles * 25 tiles. It doesnt scroll it just changes map completely.

So there is no create bitmap command any more or a supplement to do it?
the_winch
22
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 27th Apr 2005 08:50
You should just be able to use GET IMAGE to capture what is on the screen to an image.
If you are using sprites you will need to paste them onto the screen bitmap with PASTE SPRITE first.

Depending on your game it might be better off with the tile method which will run at a consistant speed. GET IMAGE can be a bit slow and there might be a bit of a delay when you change the background and capture it.

Quote: "this is not a quote"
PowerFang
21
Years of Service
User Offline
Joined: 6th Feb 2004
Location: Australia (But currently in the USA)
Posted: 3rd May 2005 19:50
Yeah but i can load all the maps at the start of the program so even if it is slower, i only have to load them once at the start which shouldn't be too bad.

I'll try get image
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 3rd May 2005 20:15
Personally I would avoid 2D at all costs if your pasting that much to the screen - I mean you could make a memblock plain of your whole level, and using psuedo 2D in a 3D environment, you would be able to show everything with vastly improved performance and visuals.

I know it's not the sort of thing 2D coders like to hear, but it is possible to maintain that 2D approach and use 3D technology. There are other benefits to using 3D that I won't go into, but I think you should definately consider switching to a psuedo 2D in 3D engine.


Van-B

Quote: "How could I condescend you?, you don't even know what it means!"

Van-B's mom.

Login to post a reply

Server time is: 2025-05-17 10:14:45
Your offset time is: 2025-05-17 10:14:45