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! / How do i tern this into a level?

Author
Message
Dumplin Boy
20
Years of Service
User Offline
Joined: 12th Oct 2004
Location: I fogot
Posted: 16th Oct 2004 21:43


How do i tern that into a level. DBC.
EddieB
20
Years of Service
User Offline
Joined: 29th Sep 2004
Location: United Kingdom
Posted: 17th Oct 2004 04:57
I am having the same probolem.

200GB HARD DRIVE 1GB RAM 256MB GRAPHICS CARD
Skeletor
20
Years of Service
User Offline
Joined: 21st Jun 2004
Location: florida
Posted: 17th Oct 2004 07:35 Edited at: 17th Oct 2004 07:36
Okay well what do you mean exactly when you say level?

If you mean how do you put that image onto the screen then its as simple as.




http://www.angelfire.com/games5/db_games/
Dumplin Boy
20
Years of Service
User Offline
Joined: 12th Oct 2004
Location: I fogot
Posted: 17th Oct 2004 08:21
Yeh but how do you load your objetc to move across it (sprite).
Skeletor
20
Years of Service
User Offline
Joined: 21st Jun 2004
Location: florida
Posted: 17th Oct 2004 09:41 Edited at: 17th Oct 2004 09:41
http://darkbasicpro.thegamecreators.com/?m=codebase_view_code&i=1a65d2451dda6f68618bcf42dfc601be

Follow this pong code


http://www.angelfire.com/games5/db_games/
pizzaman
21
Years of Service
User Offline
Joined: 18th Feb 2004
Location: Gateshead, UK
Posted: 17th Oct 2004 11:34
Try and follow this code I made.



Remember that the tiles can resemble a floor, sky, walls, etc

pizzaman
Skeletor
20
Years of Service
User Offline
Joined: 21st Jun 2004
Location: florida
Posted: 17th Oct 2004 13:13
@ pizzaman

Thats totally awesome! That code not only helps newbs but it can also help more experienced 2d coders. Last night I kept thinking of how I would implement tile collision but your code has shown me the way. Keep up the good work


http://www.angelfire.com/games5/db_games/
EddieB
20
Years of Service
User Offline
Joined: 29th Sep 2004
Location: United Kingdom
Posted: 17th Oct 2004 18:49
Thanks.

200GB HARD DRIVE 1GB RAM 256MB GRAPHICS CARD
pizzaman
21
Years of Service
User Offline
Joined: 18th Feb 2004
Location: Gateshead, UK
Posted: 18th Oct 2004 08:23
Thanks for the compliments . Tile collision is the way to go for most 2D games and is relatively easy once you get your head round it. Anyways if you need more help just ask, I usually patrol the 2D forums every 3-4 days - I wish I had more time.

pizzaman
Dumplin Boy
20
Years of Service
User Offline
Joined: 12th Oct 2004
Location: I fogot
Posted: 26th Oct 2004 05:34
Ok, Thanks.
Sly D
22
Years of Service
User Offline
Joined: 15th Oct 2002
Location:
Posted: 29th Oct 2004 20:42
Hey pizzaman your code helped me very much! I just have one question. How do you make that map scroll???

A cute looking koala with a WHAT!? THEY can't use Kalashnikovs, can they?
pizzaman
21
Years of Service
User Offline
Joined: 18th Feb 2004
Location: Gateshead, UK
Posted: 30th Oct 2004 02:23 Edited at: 30th Oct 2004 02:29
hi Cyber Freak

I'm making a late entry to the competition, so unfortunately I can't show you how to scroll those tiles yet - maybe next week when I have some time.

Edit Note: This is for scrolling a map so the player is always at the centre of the screen ala Zelda/Mario.

The concept is pretty easy though, you have an extra row and column of tiles offscreen. Once the player moves, you've got to move all the tiles in the opposite direction by the the same speed (including the offscreen tiles). Then when the offscreen tiles become fully visible you place some more offscreen tiles to keep up the illusion of a scrolling world.

You should check out the code base and look for Ian M's scrolling tile map.

pizzaman
Blue Shadow
21
Years of Service
User Offline
Joined: 6th Feb 2004
Location:
Posted: 30th Oct 2004 03:10
Hey i just wondered what happens if your tiles dont fill an exact square such as a ramp. If you want the player to travel up and down a ramp then you cant use whole tiles. Theres a picture of my level that im trying to work out collision attached to this post (click the download button at the bottom right)

Hope you can help, Cheers,

Mike (Code Monkey)

Attachments

Login to view attachments
pizzaman
21
Years of Service
User Offline
Joined: 18th Feb 2004
Location: Gateshead, UK
Posted: 30th Oct 2004 03:40 Edited at: 30th Oct 2004 08:48
@ Code Monkey

One way to do that is to create a set of collision rules for each tile. So if the tile your on is a ramp,the player will follow ramp collision.

Ramp Collision -
First you find out how far the player is in the ramp tile (and the direction of the tile). Based on how far the player is in the tile, raise or lower (depending on the ramp's and player's direction), the players coordinates. You also need to consider how steep the ramp is.

For example if you had a ramp tile(thats 50 by 50 pixels) that was lower at the left side, at a 45 degree angle and the player was heading right (assuming that their also 50 by 50 pixels); if the player was half in the ramp tile (at the left side) you would raise them by 12.5 pixels, if they were fully in the ramp tile they would be raised to 25 pixels; and if they were half in the ramp tile (at the right side) they would be raised to 37.5 pixels.

Hope that helps
pizzaman
Blue Shadow
21
Years of Service
User Offline
Joined: 6th Feb 2004
Location:
Posted: 2nd Nov 2004 01:31
Thanks for your help pizzaman. I might try and implement tile collision into my platform game then.

Cheers,

Code Monkey (Mike)
pizzaman
21
Years of Service
User Offline
Joined: 18th Feb 2004
Location: Gateshead, UK
Posted: 8th Nov 2004 03:05 Edited at: 13th Nov 2004 04:38
Well its been a week, so heres the code to scroll a tile map



Hope you find this useful
pizzaman

Login to post a reply

Server time is: 2025-05-15 19:00:19
Your offset time is: 2025-05-15 19:00:19