Log In  
Follow
Nedim

Cart #city_gen-0 | 2024-09-28 | Embed ▽ | License: CC4-BY-NC-SA

Press [Left arrow] to generate a new city

Little project I started after getting into tables and all the functionality they provide. I'd love to eventually add an "ocean" that reflects the cityscape and distorts it a little.

1 comment



ant
by Nedim
Cart #ant-2 | 2024-09-30 | Embed ▽ | License: CC4-BY-NC-SA
2

Ant algorithm

UPDATE: You can now hold down [Left mouse button] to spawn ants at the cursor location

Rules:
-if pixel is black: move forward, then turn right
-if pixel is white: move forward, then turn left
-always swap color of current pixel

2
0 comments



Cart #tile_raycaster-0 | 2024-08-23 | Embed ▽ | License: CC4-BY-NC-SA
5

Demo I made of a very simple level editor for a 3D ray caster game.

CONTROLS:

In map editor:

  • Arrows - move cursor
  • Hold X + left/right arrows - pick tile
  • Hold C + move cursor - paint tiles
  • Once PLAYER tiles is selected, press C while holding X to spawn player on map

In first person mode:

  • Left/right arrows - look left right
  • Up/down arrows - move forwards/backwards

I originally started making this as a custom level maker for a first person shooter like DOOM or Wolfenstein 3D but I had to move on to other projects.

You are welcome to make changes to my code and potentially add shooter functionality to this demo.

5
0 comments



I want to make my own raycaster game in picotron and I have been following this blog written for a pico-8 raycaster. I get an error when I run this and I am not sure what I should do to fix this issue. Help would be much appreciated.

Other than the code, all I did is make a sprite in slot 1 and draw a simple map in the map editor.

function _init()
	cam={
		x=12,
		y=12,
		a=0,
		w2d=2
	}
	scrx=0
end

function _update()
	controls()
end

function _draw()
	cls()
	map(0,0,0,0,16,16)
	circ(cam.x,cam.y,2,12)
	--for scrx=0,480 do
	--	raycast(cam,scrx)
	--end
	raycast(cam,240)
end

function controls()
	if btn(0) then
		cam.a+=0.01
	end
	if btn(1) then
		cam.a-=0.01
	end
	if btn(2) then
		cam.x+=cos(cam.a)*0.5
		cam.y+=sin(cam.a)*0.5
	end
	if btn(3) then
		cam.x+=cos(cam.a)*-0.25
		cam.y*=sin(cam.a)*-0.25
	end

[ [size=16][color=#ffaabb] [ Continue Reading.. ] [/color][/size] ](/bbs/?pid=147975#p)
6 comments



I am trying to make a top down RPG in Picotron and I want to use a combination of mget() and fget() to make collision. I understand that fget is a bit weird in Picotron but mget is also acting strange as it only reads the sprite numbers of 4 sprites in a 2x2 formation on the 0,0 corner of my map.

Is anyone else experiencing this or could this just be me being silly?

3 comments



I wrote a function that shows the mouse coordinates and sprite number of the map tile you are hovering over. I originally wrote this for myself to make checking the tiles on my map easier but figured I could share it in case anyone else finds it useful.

function debug_mouse()
	local mx,my = mouse()
	local x_offset=5
	local y_offset=5

	--window width and height
	local w=480
	local h=270

	--offset if box leaves screen
	if mx>w-20 then x_offset=-15 end
	if my>h-29 then y_offset=-24 end

	--draw debug text box
	rectfill(mx+x_offset-1,my+y_offset-1,mx+x_offset+14,my+y_offset+23,1)
	print(mx,mx+x_offset,my+y_offset,8)
	print(my,mx+x_offset,my+y_offset+8,9)
	print(mget(mx,my),mx+x_offset,my+y_offset+8*2,10)
end
13
11 comments