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 make a game like this??

Author
Message
EddieB
21
Years of Service
User Offline
Joined: 29th Sep 2004
Location: United Kingdom
Posted: 18th Oct 2004 00:48 Edited at: 18th Oct 2004 00:50


LIke in this pic how do i load my sprite on a level like this but instead of using planes. load a background image and keep the sprite on the ground line thanks in advance. Im using dbc.

200GB HARD DRIVE 1GB RAM 256MB GRAPHICS CARD
Crazy Programmer
AGK Developer
21
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Lost in AGK
Posted: 18th Oct 2004 00:59
i think its the same way as allways 2d dosent have a camera becuz its 2d and every thing is the same but on the screen shot its on its side u just have to draw a bitmap on its side so it looks like that i think thats right im not sure

LordAnki
22
Years of Service
User Offline
Joined: 22nd Apr 2004
Location:
Posted: 18th Oct 2004 05:06
nice arrows.

lets see here.

There was a topic somewhere around here either in the DarkBASIC Discussion, Newcomers Corner or this one about a sidescrolling game. Look around or do a serach on it.
Elthan
22
Years of Service
User Offline
Joined: 29th Jul 2003
Location: Spain
Posted: 18th Oct 2004 05:34
You have make 2 versions of the level (same dimensions). One is to show in bitmap 0 (screen) and the other on a diferent bitmap. On the second version you can draw the shapes (in a single color) to simulate collision areas; you can use several color for different types of collision (ground, wall, stairs,..). Then in your code, you must read RGB data from each pixel of the bitmap. The position to read could be the four corners of sprite. If one corner has a color marked as collision (on the second bitmap of course), you know when you must stop the sprite.

I hope my explanation helps you. Excuse my english.
EddieB
21
Years of Service
User Offline
Joined: 29th Sep 2004
Location: United Kingdom
Posted: 18th Oct 2004 06:32
Um its all confusin.

200GB HARD DRIVE 1GB RAM 256MB GRAPHICS CARD
Tapewormz
23
Years of Service
User Offline
Joined: 15th Sep 2002
Location: Winnipeg, Mantoba, Canada
Posted: 6th Nov 2004 20:10 Edited at: 6th Nov 2004 21:07
Tiles are your friend!
Get to know how to use arrays. You'll need a 2 dimensional array to set up your side scroller's map or platform. You'll need to use a tile system to draw your platform.

Collision detection with your tiles is simply getting your sprites position in your 2D map data and checking to see if it will or is colliding with a tile in that data.

I've provided a really, very basic way of how you can accomplish this. You can substitute the box command and paste sprites in your source. You'll need to make sure your tiles are uniform for this example. That is they will need to be 16x16 or 32x32 or whatever. You'll need to set the tile_width and tile_height variables in your source.

Simple tile tutorial:
The source file can be downloaded if you're logged in.


So what now?
Where do you go from here? Well I've outlined a list of things you can try to improve on this code. They're listed in order of difficulty or skill level. Honestly, the only thing that you may find difficult is step 7 and 8. Leave those for last.

Things to try:
1) Use sprites or images instead of the box commands.
2) Use a background image as a layer behind your tiled map.
3) Use sounds and music that changes from game play to end sequence.
4) Replace the keyboard input with joystick input.
5) Create multiple maps/levels.
6) Create larger maps/levels.
7) Enhance the movement so that player doesn't move in such large steps.
8) Offset the viewable map area to generate a side scrolling platform.

Once you've finnished the steps above, you'll have a good basic framework for your platform games. All you'll need to add is more sprites for enemies, items, players, and some ai routines for your enemies. I never bothered to mention a scoring system or anything like that. I gather that once you've made it this far, you'll have figured that out.

Show us your stuff!
I'd like to see what you can come up with using this simple source. Have fun, and don't get discouraged. If you get stuck on something, ask for help. If nobody responds, try working on another feature. Eventually, someone will help you or you'll figure it out.

Ps. Here's a penguin

Login to post a reply

Server time is: 2026-06-11 17:34:16
Your offset time is: 2026-06-11 17:34:16