Currently I'm trying to learn tline() by simply drawing the map. However, I have no idea how the parameters work. Apparently, according to the pico 8 wiki, tline()'s 5th and 6th parameters are expressed in "fractional map tiles" but I don't get what that means...
Can someone give a brief explanation?
I'm working on a farming simulator game. In the _init() function it should randomly generate the pattern on the grass tile and then randomly place the grass tile on the map (replacing any empty tiles.) However, a strange bug is occurring where some map tiles are corrupt. Can somebody explain what's going on? Use arrow keys to move around.
This is a proof of concept! It's a platformer where you use buoyancy to gain altitude. The deeper you dive, the more altitude you gain when popping out of the water! Kinda like a floatie in the pool.
Use left and right to move. Press X to dive deeper (when submerged) and O to move upwards (also while submerged). On land, press O to jump. Try to collect all the gems.
The idea: a platformer where you use buoyancy to gain altitude.
Controls: Left and right to move. Up lets you swim upwards (while submerged) and down lets you swim downwards (while submerged.)
Play around with the water physics!
PS if you can help me code map collision (which I suck at) it would be greatly appreciated!
function _init() poke(0x5f2d,1) mx,my=stat(32),stat(33) cursor_x,cursor_y=64,64 nodes={} constant={n="constant",x=0,y=0,c=8} counter={n="counter",x=0,y=0,c=3} cam_x,cam_y=-60,-63 end function _update60() if (btnp(🅾️)) new(constant) if (btn(⬆️)) cam_y-=1 if (btn(⬇️)) cam_y+=1 if (btn(➡️)) cam_x+=1 if (btn(⬅️)) cam_x-=1 end function new(n) add(nodes,n) n.x=cursor_x+cam_x n.y=cursor_y+cam_y end function _draw() chosen = nil cls(0) for i, node in ipairs(nodes) do print(node.n .. " " .. node.x .. " " .. node.y, 0, i * 6, node.c) rect(node.x - cam_x, node.y - cam_y, node.x + 8 - cam_x, node.y + 4 - cam_y, node.c) if stat(34) ~= 0 and cursor_x >= node.x - cam_x and cursor_x <= node.x + 8 - cam_x and cursor_y >= node.y - cam_y and cursor_y <= node.y + 4 - cam_y then chosen = node end end if stat(32) ~= mx or stat(33) ~= my then cursor_x = stat(32) cursor_y = stat(33) end if chosen ~= nil then print(chosen.x, 0, 0, 12) chosen.x = cursor_x + cam_x - 4 chosen.y = cursor_y + cam_y - 2 end pset(cursor_x + 1, cursor_y, 6) pset(cursor_x, cursor_y + 1, 6) pset(cursor_x - 1, cursor_y, 6) pset(cursor_x, cursor_y - 1, 6) end |
The goal: when you create a new node
object, it should be at the cursor's position. You can drag them around. Press the circle button to create a new node. Use the arrow keys to move the camera. Use the mouse to drag nodes.
The problem: whenever a node is created or clicked, every single existing node's position moves to the mouse.
I'm sure it's some small detail I'm missing but I just can't find it. I would be very thankful for your help