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! / Tile help

Author
Message
Krystlih
20
Years of Service
User Offline
Joined: 11th Dec 2003
Location:
Posted: 11th Dec 2003 22:26
Hi all:

I'm trying to write a simple tile engine. For some reason all I get is a blank screen with this code. The wierd thing is when I debug it it doesnt step through the for loops. This is the first time I've worked with dark basic so I dont know how the debugger is supposed to work. Can anyone help me out?
Krystlih
20
Years of Service
User Offline
Joined: 11th Dec 2003
Location:
Posted: 11th Dec 2003 22:26
forgot to add code:

zircher
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 12th Dec 2003 00:04
Comment out the get image commands, your telling the program to get image data from the blank screen and overwrite the images that you have loaded.

disp(t,r)=rnd(5)

This generates numbers from 0 to 5, IIRC. Try:

disp(t,r)=rnd(4)+1

Also, the sprite commands create sprites. Try paste image instead.
If you really want to create sprites, your sprite ID logic needs help.

Try this inside the second loop:

sprite (ti*maxdisph)+ri, ti*32, ri*32, disp(ri+1,t1+1)

That should save you the five IF statements and properly increment your sprite count.
--
TAZ
Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 12th Dec 2003 01:37
Instead of Load Bitmap use Load Image....Then don't bother getting them at all.

Pincho.
zenassem
21
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 12th Dec 2003 02:56
Pincho,
Load image messes up the graphics of tile images when I use it. I think it's a known bug. If not hasn't anyone else experinced problems with their images when using load image instead of bitmap? My sprites and images seem to have distorted pixels when I use Load image.

Cna anyone confirm this?

▒░▒░♂♀░▒░▒
CloseToPerfect
21
Years of Service
User Offline
Joined: 20th Dec 2002
Location: United States
Posted: 12th Dec 2003 06:52
I would just use LOAD IMAGE not LOAD BITMAP it always works for me. as for it messing up the graphics, are you talking about the mipmapping? if so just add a ,1 on the end of the LOAD IMAGE command (LOAD IMAGE "grass1.bmp",1,1)
but if you really want to load bitmaps then you must swith to the bitmap before you can get a image from it.

load bitmap "grass1.bmp",1
set current bitmap 1
get image 1,0,0,32,32,1
set current bitmap 0
delete bitmap 1


it is alot more work that way.

CTP

Lifes short, try to enjoy it and not take it to seriously!

Login to post a reply

Server time is: 2024-05-02 11:11:51
Your offset time is: 2024-05-02 11:11:51