Log In  
Follow
yaky

While making a top-down map for my game, I needed to arrange some of its parts to fit better together, which required rotating some sections. Since PICO-8 does not provide a way to rotate a map selection, I wrote a simple utility function to do that.

This function rotates a square section of the map clockwise.
MX and MY are the map X and Y coordinates of the upper left corner, and MS is the length of the square side - 1 (e.g. to rotate an 8x8 square, set MS=7)

Notes:

  • Make sure that you do not modify the map in any way before you call the rotate function, or the in-memory changes will be written to the cart
  • Uncomment the second CSTORE (or edit the to edit the lower portion of the map
  • This function is not optimized and is not intended for frequent use (unless you are making some gravity-based platformer, I suppose...)
-- rotate a square section 
-- of a map clockwise
function rotate_map(mx,my,ms)
	-- read tiles

[ [size=16][color=#ffaabb] [ Continue Reading.. ] [/color][/size] ](/bbs/?pid=152999#p)
1
0 comments



Cart #dark_streets_tech_demo_1-1 | 2024-03-01 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
25

Dark Streets Tech Demo 1

Hi all! Dark Streets is a first-person shooter, mechanically most similar to Wolfenstein 3D or Blake Stone, but also inspired by Doom, Blood, and Ion Fury. I have been slowly developing this game in my free time over the last year and a half. I referenced LoDev and a paper by Amanatides and Woo for some of the raycasting steps, but the rest of the code and graphics are mine. Enjoy a small preview!

Raycasting renderer

Since the setting of the game is a city, I specifically wanted to write a renderer that could draw tall buildings, short objects, doors, and interiors. I think I am pretty close.

  • Pretty performant: Everything below takes up only 50-60% of CPU, unless you go crazy with geometry and distances.

[ Continue Reading.. ]

25
8 comments