hello,
So Im making a kinda rpg-topdown-engine-game-thing and I want to have the function for the player to collide with other players. so it looks like this:
But here is the problem!
You see, the player checks if the tile he is about to go to is a wall or another player, if so he goes back (doesn't move). seems ok, right?
NO
players are stored in a big table players={} and the checking process is done in a foreach loop. So when the player below moves up, he sees that there is someone above, he doesn't move, but the upper one moves. Its hard to explain look:
did you see it? when I pressed down only the bottom player moved. Because the upper one (index 1) checks first and sees that there is a player below him, no move. then the bottom one checks and moves.
How can I fix this?
If you have any questions for the code or the game feel free to ask.
Thanks for taking your time to read this :)
Just found out that the “goto” function is actually implemented in Picotron; I’ve tested a pico8 code snippet by @ultrabrite and put it into the usual function _draw()
function _draw() cls() x=1 y=0 n=120 ::io:: d=rnd(2)>1 and 0 or 5 line(x+5-d,y,x+d,y+5,11) x+=6 if(x>n+6) x=1 y+=6 print(' ') if(y>n) y=n flip() goto io end |
WIP Post-Jam Ludum Dare 55 - "Summoning"
ā¬ ļø to move wizard left
ā”ļø to move wizard right
ā (or x
) to shoot your magic
š Zap the devils before they get to your level!
š„ Avoid the fireballs, your magic is powerless against them.
Go for the high score!
Virtual Keyboard app for Steam Deck and other touchscreen devices.
Working (albeit still WIP) as of Picotron v0.1.0e but not v0.1.0f due to changes in wm. I haven't looked into how much is different but I do know that the way I was switching workspaces is no longer exposed as an event within wm, so that kills the project dead somewhat.
I'm not upset because Picotron is in flux and it was always possible that this could happen. However I feel a virtual keyboard is a must for handheld devices in the future as Picotron is totally unusable without one. Yes, the Steam Deck has a virtual keyboard built into Steam, but hitting Return hides it, so it is impractical. Plus it doesn't have cursor keys which this did.
Here I come again with my 2nd arcade game vibe: Clownvaders! rebuild from scratch as pico-8 to deluxe arcadetron Edition.
Controls:
Left, Right, X to shoot
more info, watch the attract mode.
Enjoy!
Rev 3:added extra background, better music, gameplay demo in attract mode
rev 4: extra and inproved level's backgrounds picts, level completed fixed.
I've seen this behavior in both sfx.p64 and #visitrack. I'm on a M1 Macbook Pro, OS X 14.3, running Picotron 0.1.0f.
- Slow drags downward don't do anything -
mouselock
just returns 0 fordy
, regardless of how far you drag. Slow drags upward do not have this problem. - Effective sensitivity is lower on Mac than on other platforms. I haven't verified this myself, but based on @drakmaniso's description of how the sliders should be acting in #visitrack, this seems to be true.
Hello,
For fun, I'm building a Vampire Survivors style game. There will be a lot of mobs on screen, so I've built a grid partitioning system and each weapon only checks for collisions with mobs nearby.
The grid size is 30, so that's a 16 x 9 grid.
My question is this, currently, I'm initialising the grid on every frame and re-populating all the mob positions into their grids.
Should I move to initialising just once and updating mob positions in the grid on every frame? I'm not sure whether that will actually be quicker because I will have to delete the mob from one grid position and add it to another.
Also, that seems hard to implement :-)
Thanks in advance
Russ
Hello!
I'm trying to understand how to best work with image data in Picotron for use in things like .txt files and whatnot.
In the readme that rests on the pictron desktop, there's an image near the beginning of the file that, when clicked, reveals a metadata object that is "unpodding" base64 encoded image data so it renders in the txt editor.
How would I go about podifying a sprite on a .gfx file so I too can insert the base64 data into a .txt file?
I've tried doing something like this:
?pod(fetch("/ram/cart/gfx/0.gfx"),0x7) |
in the picotron terminal, and it outputs the b64, but it's podifying the entire gfx file, not the sprite I want to podify (in this case, sprite 1, second slot available on the gfx file).
Anyone have any ideas here?
I'm drawing the map like this:
-- 2 is the layers count for i=2,1,-1 do map(fetch"map/0.map"[i].bmp) end |
And I can check for collisions for map tiles with fget(mget(x/16,y/16))
to get the flag of the tile, all good here, except I can only check for collisions on the top layer, while every other layer is ignored.
How can I check for the flags on every layer?
A simple demo, wallpaper, or screensaver. Circles of various sizes move across the screen, influenced by your mouse position.
load #circle_chase-0
and run!
i'm trying to use :copy when growing a userdata:
local a = vec(1, 1) local b = vec(0, 0, 0) a:copy (b) print(b) -- b is still zero |
i figured maybe the vectors needed to be the same size but neither of these work either:
local a = vec(1, 1) local b = vec(0, 0) local c = vec(0, 0) a:add (0, b) a:copy (c) print(a) print(b) print(c) |