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.

Dark GDK / Sprite Collision

Author
Message
Cole Xemi
16
Years of Service
User Offline
Joined: 20th Aug 2008
Location:
Posted: 21st Aug 2008 05:41 Edited at: 26th Aug 2008 20:34
I am using dbSpriteCollision() to dectect Collision between my character and the attached image. Is there any way to make it so my character can walk through the tannish area and with dbSpriteCollision() only for the green walls? Do alpha channels just make the sprite transparent?


Edit: Fixed it I just created an array of my sprite through Mappy. Solid is 1 and anything else I can walk through. Here is the collision code:


Attached is my Zelda demo. Zelda 4! xD There are still a few bugs left though. Thanks guys.

Attachments

Login to view attachments
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 21st Aug 2008 07:25
The dbSetSpriteAlpha command makes all of the tan invisible if set to that color. You need to make the maps tile-based.

Windows Vista Home Premium Intel Pentium Dual-Core 1.6 Ghz 1GB DDR2 RAM GeForce 8600GT Twin Turbo
Cole Xemi
16
Years of Service
User Offline
Joined: 20th Aug 2008
Location:
Posted: 21st Aug 2008 21:24
How would I make the maps tile-based? I'm kinda new to this.
Movian
16
Years of Service
User Offline
Joined: 5th Mar 2008
Location:
Posted: 21st Aug 2008 23:25
you know looking at that image reminds me of Zelda for the NES
that was a fun game.
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 22nd Aug 2008 01:05
Quote: "you know looking at that image reminds me of Zelda for the NES
that was a fun game. "


I think that's where the tree sprites are from.

Quote: "How would I make the maps tile-based? I'm kinda new to this."


Do some googling. Something like "2d tile based", and see what comes up. There are some good tutorials out there.

Windows Vista Home Premium Intel Pentium Dual-Core 1.6 Ghz 1GB DDR2 RAM GeForce 8600GT Twin Turbo
Movian
16
Years of Service
User Offline
Joined: 5th Mar 2008
Location:
Posted: 22nd Aug 2008 03:10 Edited at: 22nd Aug 2008 03:11
Quote: "Quote: "How would I make the maps tile-based? I'm kinda new to this."

Do some googling. Something like "2d tile based", and see what comes up. There are some good tutorials out there."


if i where goign to do it i would set up an array of interegers. that would represent the screen. then i could asign each "tile" a number that would allow me to assign it properties. eg if a "tile" in my array = 1 then its solid and you can't move to that tile. if its a 0 its open ground and you can walk on it if its a 3 then its lava and you can move on it but you take damage etc etc etc

thats how i would go about doing it to start. But i would agree, google is your FRIEND!
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 22nd Aug 2008 04:25
Quote: "thats how i would go about doing it to start."


Yep! The, it's just a matter of drawing functions for the tile map. But, Google will teach you to do that in more detail than we can here.

Windows Vista Home Premium Intel Pentium Dual-Core 1.6 Ghz 1GB DDR2 RAM GeForce 8600GT Twin Turbo
Cole Xemi
16
Years of Service
User Offline
Joined: 20th Aug 2008
Location:
Posted: 22nd Aug 2008 05:10
OK. I have found a neat tool called Mappy that creates 2d tile based maps. Does the 2D array and the image(Bitmap file type) go hand and hand? Example: does Testmap_map0[0][0] = Top left square of the Bitmap? Would I use dbLoadBitmap() to draw my image to the screen? And Google didn't really help me much. You guys did.
Movian
16
Years of Service
User Offline
Joined: 5th Mar 2008
Location:
Posted: 22nd Aug 2008 11:08 Edited at: 22nd Aug 2008 11:14
yeah [width,height,tileproperties] so you eg[0,0,0] = your image id for the top left square [0,0,1] = your tile property (can you walk on it ?) etc.

im guessing that program you mentioned takes your image and it just cuts it up in to blocks ?
Cole Xemi
16
Years of Service
User Offline
Joined: 20th Aug 2008
Location:
Posted: 22nd Aug 2008 20:28
It creates an array based off a map you create with Mappy. The only problem I'm having is dbLoadBitmap() is not displaying anything.
elantzb
16
Years of Service
User Offline
Joined: 10th May 2008
Location: Classified
Posted: 23rd Aug 2008 07:13
I would use dbSprite()

~you can call me lantz~
Movian
16
Years of Service
User Offline
Joined: 5th Mar 2008
Location:
Posted: 27th Aug 2008 22:39
Xemi could you pm me with updates for this,
i would be interested in playing this

Login to post a reply

Server time is: 2024-09-30 05:38:28
Your offset time is: 2024-09-30 05:38:28