I just noticed the += shorthand doesn't work the way I expected with comma separated values.
For example:
x,y,z=1,2,3 x,y,z+=10,20,30 |
Sets x to 11 as expected, but y and z are set to 20 and 30 respectively, rather than 22 and 33.
Should the last line be equivalent to:
x+=10 y+=20 z+=30 |
?
Or is there some reason I'm missing?
I was interested in making a type of high-number integer counter relying on the length and accuracy of 4-digit decimal numbers less than 1 when I came across this little slice of misfortune.
Here is the source to see there is no complication on my part:
-- real numbers are flawed! function key() repeat flip() until btnp(4) end b=1 e=10 for i=1,5 do cls() ?"counting "..b.." to "..e.."." key() ?"" for i=b,e,b do ?i end key() b/=10 e/=10 end ?"" color(10) ?"complete!" repeat key() until forever |
Following the vein of word quiz animals I have now made another version.
Code wise it now enables to use funcitons instead of sprites.
The drawing function do not use any global variable besides the tick number (tick+=1 every _update()).
Any suggestions would be welcome.
To do:
better mainpage.
MOAR shapes.
A free-to-use template for a main menu system, at only 106 tokens! (130 includes the example menu items). Simply edit the mbutts list to add your own options. I encourage you to adapt and modify the code (it's pretty vanilla right now and in dire need of beautification from a bright young go-getter like yourself).
I'm sure this has been done dozens of times already, but I thought it would be fun to give it a go.
So here's a simple Wolfenstein 3D style ray-caster.
There's no game-play at all, you can just move around.
You can edit the level in the pico8 map editor (make sure it is always enclosed, otherwise you'll get an infinite loop - rays only terminate when they hit a wall).
Update: Cleaned up & optimised code. Added textured ceiling and floor.
A crude test program to emulate the HDMA behaviour of the SNES.
Current features:
--background tiling
--scrolling background
--scaling background
--changing scaling between drawing lines
Runs VERY slowly.
UPDATE: changed a bit of code to fix some graphical errors. (Don't do math on indexes. It causes issues.)
Here is my code so far. I am trying to get the fish on the screen to move in an upward motion by itself, after I can master this I am going to try to do a collision detection for if the frog touches the fish = game over. Can anyone give me pointers on making the fish move by itself? Thank you
function _update()
fish_sprite+=18
if fish_sprite > 19 then
fish_sprite=18
end
char_sprite+=1
if char_sprite > 9 then
char_sprite=1
end
if btn(0) then char_x=char_x-1 sfx(05) end
if btn(1) then char_x=char_x+1 sfx(05) end
if btn(2) then char_y=char_y-1 sfx(05) end
if btn(3) then char_y=char_y+1 sfx(05) end
end
fish_sprite+=18
if fish_sprite > 19 then
char_sprite=18
end
function _draw()
cls()
map(0,0)
spr( char_sprite, char_x, char_y)
spr( fish_sprite, fish_x, fish_y)
print( time())
end
Features
Save and Load
Achievements
Fast Score-Attack Action!!!
Description
You play as the Galactic Grasshopper rescuing imprisoned citizens from the evil empire.
Grasshopper bores into a prison asteroid and then leaps out, rescuing the prisoners as he exits.
As he rises up, enemies teleport into the hole he bored.
Rescue the prisoners and flee the asteroid!
Each round is harder than the last, having more enemies that are increasingly aggressive, but also more opportunities to score.
Instructions
Go Up, Save prisoners, blow up enemies
Press up to jump
Your jump sends out an attack that will destroy enemies
Press the action button to activate your shield. It has a cool-down period and cannot be used while Grasshopper is flashing.
Hi everyone,
I'm currently working on a multiplayer 3D platform game where players spawn into a room and must jump across platforms to get to the next door. the door then teleports all players to the next room for players to progress through.
The issue I am having is : The door works if player 2, 3 and 4 use it, however when player 1 goes through the door the game ends and the score screen comes up.
Any help or suggestions would be greatly appreciated!
Start:
If 1st player enters door:
If 2nd player enters door:
Was curious to know if you could run and program modern Pico-8 (pico-8_0.1.12c) on this particular piece of hardware:
https://store.planetcom.co.uk/collections/devices/products/gemini-pda-1
Also, do you have Pico-8 running on something off the shelf of a desktop Windows computer ? If so feel free to reply with your findings, both positive and negative, on the portable device you run yours from.
... Or can you recommend some device outside of PocketCHIP that effectively runs Pico-8 and allows you to efficiently code on it besides ?
I'm trying to avoid any reviews of PocketCHIP as the keyboard and physical design look REALLY BAD. (can't fold it and looks like a puffed up membrane keyboard). :(
In all case, please include images, links, and/or prices of the other compatible hardware if they are not readily apparent.
Is this working with Pico8?
Could you please have a look:
http://retroflag.com/GPi-CASE.html
Where can I download the rasberry pi version?
Calculators have always fascinated me. For that matter numbers. Even before I could bring Dad's calculator to school I was busily working on paper with digits 0-9. Fascinated, just ... fascinated by what they meant, what they implied, and what they COULD mean with new definitions.
When I finally understood computers, I was quite interested. No, that's not the right word. I was OBSESSED. Obsessed to the point of mania would it could mean. What I could do. And what I could do with tools that worked with these numbers. Tools within tools. Numbers within numbers ...
So perhaps this is a work of love, real love, for the majesty and magnificence of numbers.
With that out of the way, let me show you what I have done.
I suppose it's a bit of a calculator, but with a difference. You can have ANY number of digits. And I mean any. Right now I have it scaled for 64-digits. That includes positive and negative.
Most importantly, it does NOT do it a single number at a time as you can tell. No, it truly does add and subtract every digit intelligently. So if you have 16-digits set. Then it will take no more than 5-loops or 80 looped statements to get the right value.