Log In  

BBS > Superblog
Posts: All | Following    GIFs: All | Postcarts    Off-site: Accounts

Cart #44020 | 2017-09-09 | Code ▽ | Embed ▽ | No License
7


by LE PRINCE Jules

7
2 comments


I'm working on the classic memory matching card game, Concentration. My work-in-progress is below, but I have a beginner question regarding best practices when coding on the Pico-8.

The grid of cards is currently maintained using a 2D Lua table with each cell containing a few properties such as the picture to display and whether it's flipped or not. This is working well enough, but... I could just as easily store the card faces in the Pico-8's map data. The same goes for the collection of cards collected by each player. In fact, this game doesn't need to store any values greater than can be fit into 8 bits so I could potentially store all data this way. I'd simply be exchanging Lua table lookups with memory reads and writes.

I guess my question to more experienced coders is whether leaning on Lua data structures or Pico-8 memory structures is preferred? I don't expect that there is one simple answer to that, but are there pros and cons I might not be aware of after having read through the manual a few times?

[ Continue Reading.. ]

9 comments


Cart #44008 | 2017-09-09 | Code ▽ | Embed ▽ | No License
7

Asteroids!

A clone made by @mccolgst

Press Z to start or to fire

Left and Right Arrows to aim ship

Up Arrow to thrust

Still new to game development, and I didn't realize how much I was getting myself into by making this 'simple' clone! Learned a bunch of cool stuff about geometry and a lot of cool and interesting features in pico8 (like how the sin and cos functions work) Very fun!

7
5 comments


I figured out that you can use strings to set up a lot of content cheaply, and I understand that others are using procedural generation to get the same effect. All well and good, but that only works for static content. If you want a longer game where you can make changes that persist across sessions then the 256 byte limit on permenant storage is crippling. The game I want to make is basically impossible unless I use two or three extra carts JUST for their quarter-of-a-kilobyte save space. That seems a bit silly, especially since I'll be punished for it by not being able to use the BBS.

Could we get a little more room, please? Keep in mind that even carts for the original Gameboy could potentially have up to 8K of save space. I don't think that allowing 1K would violate the spirit of the PICO-8, and it would open up a lot of possibilities.

21 comments



Cart #43983 | 2017-09-07 | Code ▽ | Embed ▽ | No License
2

2
2 comments


Cart #43982 | 2017-09-07 | Code ▽ | Embed ▽ | No License
6

Hello,
I am a French developer who recently discovered PICO-8.
To celebrate the 20th anniversary of the release of the Harry Potter book, I designed a small game called HARRY POTTER QUIDDITCH.

The game is quite simple. You have to move Harry Potter with the Left, Right, and UP keys. You have to catch the Golden Snitch in less than 30 seconds. There are a total of 7 levels. Be careful, from the level 3, avoid touching the other players, otherwise the game is over.

For more fun, the game works with the Space Bike. This is an exercise bike that works with an electronic Makey Makey cardboard. The game will be playable for the general public from 14 to 28 October 2017 at the Françoise Sagan library in Paris.

[ Continue Reading.. ]

6
2 comments


How does one make a player constantly animated?

Context: I am attempting to make a sandbox game about a honeybee. I need the honeybee's wings to always be in motion.

2 comments


Cart #44102 | 2017-09-11 | Code ▽ | Embed ▽ | No License
28

Hint: Tapping the button in the air will get you further horizontally than holding it.

Version 1.1: Fixed a screen that could lead to a softlock

I'm not sure how to reply to peoples comments directly in this forum so until I figure out how just know that I am overjoyed by your kind words. Thank you all so much! Your awesome!!

28
11 comments


Cart #43940 | 2017-09-05 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
12

12
4 comments


Cart #43934 | 2017-09-05 | Code ▽ | Embed ▽ | No License
18

R A I N B A L L
B L A S T !

Harness the power of color!
Collect hats!
Be a sentient blob!

If you can reach the goal score for each level, you can play the level with a cool hat! Reach the goal score in all four modes to become a Rainball Champion!

18
1 comment


I can never resist an opportunity to mess around with regular expressions, so here's my attempt at a code minimizing script.

https://github.com/centuryglass/phantasos/blob/master/minimize.pl

If you already have perl installed, you just need to run 'perl minimize.pl yourcode.p8'. It will output the minimized code to 'yourcode_min.p8". Token mappings are also saved as 'yourcode tokens.txt' to make debugging easier. I've only tested it with my game and a few random carts. Let me know if it doesn't work on your code, I'm sure there are a couple obscure reserved words and odd failure conditions I've missed.

1 comment


Greetings all,

New PICO-8 customer here. I've been going over the manual and I'm a bit confused about something. In the Memory section it says "Colour format (gfx/screen) is 2 pixels per byte," which implies 8-bit. But in the Lua Syntax Primer section it says "Numbers in PICO-8 are all 16:16 fixed point," implying 32 bits. In that case you should be able to store 8 pixels-worth of color data per byte.

So what gives, exactly? Can I POKE 32-bit values into sprite/map slots for extra data storage?

11 comments


Cart #43907 | 2017-09-04 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2

Welcome to the Dungeon Tetris !

Could you survive to the twenty level of a remake of Tetris ?

Use the arrow key to move and turn your pieces !

Base code from lesson at www.gamecodeur.fr acdademy by David Mekersa.

Post your best score on the page !

Coded in PICO-8 by Petitrudy from PR-Gaming Studio

Bienvenue dans Dungeon Tetris !

Pourrez-vous survivre aux vingt niveaux de ce remake de Tetris ?

Utiliser les touches de la croix directionnelle pour déplacer et faire pivoter vos pièces.

Poster votre meilleur score sur la page !

Le code source est tiré d'un atelier www.gamecodeur.fr par David Mekersa.

Codé en PICO-8 par Petitrudy - PR-Gaming Studio

2
2 comments


Cart #43904 | 2017-09-04 | Code ▽ | Embed ▽ | No License
4

Just a little demo for evoke 2017. I had 3 months to learn how to code and do stuff besides making music. It was fun and I think I'll do one more. :)

Don't sweat it, if you're confused by the content, since it contains a lot of jokes towards the organizers of the party.

Got a lot of help from looking at other peoples code in the forum and the discord. Thank you for bringing me from "I can do music" to "I can make a Lambodino drive towards Cologne"! <3

4
4 comments


I recently tried to implement an enum structure in Lua, which turned out to be very useful. So I thought I might share it here :)

Find the latest version here (it's part of a Pico-8 library) https://github.com/sulai/Lib-Pico8/blob/master/lang.lua

Then enum(...) function generates an enum structure from a list of names.

The generated structure is useful when it comes to readability and object orientation.

As a use case for Pico-8, you can comfortably generate named objects that map to sprite ids. So if you want to associate names to your sprites like "sword", "shield", etc to show that to the user, this is a nice way to do it.

Example usage in a RPG:

tiles = enum( {"grass" ,"water", "rock"} )     -- landscape sprites start at 1
items = enum( {"sword" ,"shield", "bow"}, 16 ) -- item sprites start at 16
colors = enum( {"black", "blue", ... }, 0 )    -- map color palette.
actions = enum( {"look", "take", ... } )       -- just an enum.

[ Continue Reading.. ]

5
5 comments


Cart #43897 | 2017-09-03 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
26

This is a work in progress output from a vector animation tool i'm writing in javascript/canvas.

The tool enables you to use the mouse to draw vector shapes and import them into pico8 as data, to be used the same way you would use a sprite, but with scaling and such.

Its not quite finished yet so i'm not letting the vector tool out to the public but here is some output.

This is the legend MC hammer, rotoscoped into low poly 2d over some of @guerragames tweetcarts from twitter (used with permission).

The way the cart displays the polys is some super fast tri code i found here on the forum. I'd like some help in making it faster and i think the person who write is is here:
https://www.lexaloffle.com/bbs/?tid=28317

Its the vector tool i'm showcasing really. :)

Tweet (with gif) here: https://twitter.com/gabrielcrowe/status/904421706659495936

Online tools to do this soon, I promise.

26
10 comments



Hey there, I did a few weeks ago a mini cart showing how Earthbound or Mother 3 would do most of the background effects.

I redid the whole routine and made two versions, vertical and horiztontal, which should cover a big part of the basics behind those games' technique (the rest being layer blending, scaling, palette cycling, or alternating backgrounds per line).

There are two implementations, sspr-based and map-based. The sspr based uses the data of a sprite at given coords and size to tile it on the screen whereas the map-based routines uses the map routine to directly draw a line of pixels on the screen. The map-based routines uses part of the map data but it makes up for allowing more than one sprite to be used, as you can see with the sample's colored corner areas.

Notes about the implementation:

  • I used time, amplitude, frequency and scale as global variables to make the implementation a bit less repetitive but you can pass them as arguments to the functions to have different settings
  • The map-based routines (map_<routine name>) assume that you're using at least a 16*16 map, but can be bigger. I haven't programmed an iteration allowing to use smaller maps to make it faster (as it'd use more than two map calls per line)
  • The map routines overrides camera and clip settings. Make sure to save their context before using.
4
0 comments


Working on my game, I often find myself wondering how much cpu such or such construct uses.
I do my benchmarks using stat(1).
Issue is, my measures are all over the place according to the number of samples :[

Ex: Let's bench band vs. % and shr vs / @ 100 calcs/update

Good, % is almost free, / is slightly better than shr
Let's try 200:

Hu? shr is now better than /

Push it to 300:

Back to "normal"

400:

WTF?

How come number of samples for a given run is turning results upside down?
Note: if I push number of iterator further, I tend to have stable results - but who's performing 5000% per update cycle?!?
On top of that, @zep, we should be provided with op cost of basic operations (similar to cpu specs).

Reference code:

function bench(name,n,fn)
	local t0=stat(1)
	for i=1,n do
		fn(i)
	end
	return {name,(stat(1)-t0)}
end
function stat2pct(s)
	return flr(1000*s)/10
end
function bench_draw(name1,stat1,name2,stat2,y)
	print(name1.." vs. "..name2,1,y,7)
	y+=6
	local total=stat1+stat2
	local pct1,pct2=stat1/total,stat2/total
	local c1,c2=8,11
	if(stat1<stat2) c1=11 c2=8
	local x=flr(128*pct1)
	rectfill(0,y,x+1,y+6,c1)
	x+=1
	print(stat2pct(stat1),x/2,y+1,0)
	local x2=128*pct2
	local msgx2=x+x2/2
	if(x2<1) then
		x=127 x2=127 msgx2=120
	end
	rectfill(x,y,x+x2,y+6,c2)
	print(stat2pct(stat2),msgx2,y+1,0)
	y+=8	
	return y
end

local res={}
local n=100
function _update60()
	if(btnp(0)) n-=100
	if(btnp(1)) n+=100
	n=max(n,100)

	res={}
	add(res,bench("band",n,function()
		j=band(546,127)
	end))
	add(res,bench("%",n,function()
		j=546%128
	end))

	add(res,bench("shr",n,function()
		j=90/8
	end))
	add(res,bench("/",n,function()
		j=shr(90,3)
	end))
end

function _draw()
	cls(0)

	rectfill(0,0,127,6,1)
	print(n.." iterations - \139\145 to change",1,1,7)

	local y=9
	for i=1,#res,2 do
		y=bench_draw(res[i][1],res[i][2],res[i+1][1],res[i+1][2],y)
	end
end

[ Continue Reading.. ]

5 comments


Cart #43885 | 2017-09-03 | Code ▽ | Embed ▽ | No License
25

Arrow Run is a fast-paced auto-scroller platformer!

Use your platformer and aiming skills to dodge spikes, collect coins and hit targets on this retro arcade-like game!

This was my entry for the "My First Game Jam: Summer 2017", it has been updated already a few times after that though.
>tch.io page<

25
8 comments


Cart #43869 | 2017-09-02 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
3

Mandlebrot fractal renderer with random color cycling.

3
0 comments




Top    Load More Posts ->