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 / 2D Collision Maps, Layers, To Sprite or Not To Sprite

Author
Message
Naphier
14
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 22nd Dec 2011 20:50
This came up out of VG Teacher's original thread here which I sort of hijacked and don't want to continue to do so.

There were some really cool ideas coming out of guys like zenassem,nonZero, and Chris Tate that inspired me to try some various collision mapping methods.

I thought to myself (and out loud): "Self, wouldn't it be sweet if I could just simply draw an image and tell DBPro what colors represent boundaries for collisions?"

So here's the first, simplest attempt that I was able to toss together in a spare few minutes today.
You just paint a terrain in GIMP or your favorite BMP creation tool (if it isn't GIMP then you should try it).
In this version the ground has to be green. For some reason I had to open up green to a range or was otherwise getting stuck. Maybe I have some non-green pixels in the middle of my green land... not a worry.

So this makes use of the apparently slow point(x,y) command. I'm not sure if it causes any issue in this simple of a program, but there is something that causes a random extra delay... like the wait cycles get stacked up and then release... could be busy CPU though...

Anyway for those of you who want to try something a little different:


Next attempt will be something a bit more universal and utilizing memblocks instead of bitmaps and the infamous point(x,y) command. Maybe a scrolling background too... we'll see.

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-11-23 23:55:23
Your offset time is: 2024-11-23 23:55:23