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.

DarkBASIC Discussion / Best type of image to use for "sprites" in a 2d scroller...

Author
Message
gaz5021
18
Years of Service
User Offline
Joined: 18th Oct 2006
Location:
Posted: 19th Oct 2006 14:44
Following on from my 2d background I'm making with a matrix (http://forum.thegamecreators.com/?m=forum_view&t=91424&b=10), I was wondering if somebody here could suggest the best way to go about putting 2d characters onto this "matrix" background. I have heard people talk about using "paste image" instead of actual "sprites", and I know DBC can handle bitmaps as well. Can someone please explain in reasonably simple terms which they think is the better way to do it and why? Thanks in advance.
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 19th Oct 2006 22:18
You only want to use bitmaps when you (like that messages attached file: tilebitmap.bmp) have multiple images to grab separately. If you're grabbing single images always use "load image".

When you use sprites their on top of everything... so things like text drawn to the screen is under the sprites. Hiding the sprites and using "paste sprite" gives you greater control and gives you the benifit of using all the sprite commands to manipulate the sprite.

If you really want to make a 2D game i'd keep away from making a matrix. It's just as easy (and faster) to just make a background using pasted tile images.
gaz5021
18
Years of Service
User Offline
Joined: 18th Oct 2006
Location:
Posted: 22nd Oct 2006 14:30
Okay, thanks a lot for your advice.

Being a complete beginner with DB, I am going to take all of your advice on board as act on it. I'd like to develop good habits early.

First of all, I will scrap the matrix code. That's where I started.

When you say "using pasted tile images", do you mean pasting each background tile separately with the command "paste image"? I'm guessing I need to get the images from the bitmap with "get image" (like I have at the moment) and specify where each tile is.

I'll try it this way anyway, and keep a look out for your answer.

Thanks again.
gaz5021
18
Years of Service
User Offline
Joined: 18th Oct 2006
Location:
Posted: 22nd Oct 2006 18:35
Okay, I've changed my program so that the background is drawn with 32*20 "paste image" commands. Seems to work well, I've also got it scrolling. I'll include the code, it's very messy, I'm changing lines to comments instead of deleting them, just so I can look back on it. It's working, though.



Thanks a lot for your help so far, I'd like some more info about "paste sprite" and what you mean about "hiding" the sprite. As you can see, currently I am just using the "sprite" command.
gaz5021
18
Years of Service
User Offline
Joined: 18th Oct 2006
Location:
Posted: 24th Oct 2006 19:43
I've tidied up my code a bit and improved it, at least I think I have. Does anyone have any information on why I should be using "paste sprite" or any other suggestions for displaying my character images?

Thanks.

gaz5021
18
Years of Service
User Offline
Joined: 18th Oct 2006
Location:
Posted: 25th Oct 2006 18:57
Fixed up my code a bit more. Anybody have any advice at all for displaying my characters to the screen? SPRITE seems to be working but I really want some opinions.

Attachments

Login to view attachments
gaz5021
18
Years of Service
User Offline
Joined: 18th Oct 2006
Location:
Posted: 28th Oct 2006 18:07
Update on my program, very happy with my progress so far. Any tips on sprites still welcome.

Login to post a reply

Server time is: 2025-05-25 21:55:56
Your offset time is: 2025-05-25 21:55:56