2D game scrolling code

Cool ways to do cool things.
wayne
Posts: 17
Joined: Sun Apr 24, 2005 8:27 pm
Location: Wahiawa, HI

2D game scrolling code

Post by wayne »

A reasonably simple scrolling code for a 2D game

This newest update uses sprites for the map. It is much faster than the old version and uses only one window. Thanks, Cundo, for the inspiration!

Contains code to load a map, bitmaps for terrain features, and characteristics for each map square, and code to move the map around. (Use arrow keys)

Contains rudimentary code to move a character around on the map and check location attributes

.zip file contains .bas file, a .dat file with a demo map and some .bmps

bas file is commented extensively
You do not have the required permissions to view the files attached to this post.
Last edited by wayne on Fri Mar 12, 2010 9:02 pm, edited 1 time in total.
wayne
Posts: 17
Joined: Sun Apr 24, 2005 8:27 pm
Location: Wahiawa, HI

Post by wayne »

Another copy of the program with a monster added to walk around on the screen independent of the main character.

It's been polished a bit; I changed some IF - THEN routines to SELECT CASE, moved a few routines around so they would only execute when needed and got rid of a few redundant items.

The monster now walks around without hitching when the character moves and doesn't "stick" and "hop" as the map moves.

Next job is to refine it to read sprite images from a .dat file for characters and monsters. Also, maybe make multiple monsters, special items, etc etc etc

There is no code to detect sprite collides and the monster can walk through barriers.

Also need a scheme to load map.dat and character/monster files on the fly so the game can change maps and stuff between levels.
You do not have the required permissions to view the files attached to this post.