Log In  

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

Hi all,

I'm writing a short graphical text adventure for the PICO-8, and a few weeks ago I determined that I needed a vector graphics editor capable of outputting PICO-8 code. I've created a web app called GMagic that lets you make vector drawings on a canvas, then export Lua functions for drawing them. I also provide the functions for drawing polygons and polylines:

ptstr() (needed for the functions):

function ptstr(s)
	local data={}
	local wip=''
	for i=1,#s do
		r=sub(s,i,i)
		if(r==',') then
			add(data,wip+0)
			wip=''
		else
			wip=wip..r
		end
	end
	add(data,wip+0)
	return data
end

Polygon:

function poly(r,c,p)
	local t=ptstr(r)
	--based off alienryderflex.com/polygon_fill
	--t=table x1,y1,x2,y2...
	--c=colors (hex)
	--p=pattern
	local pc=#t/2
	local px={}
	local py={}
	local my=127--miny
	local xy=0  --maxy
	--split out xy lookups
	for i=1,#t-1,2 do
		add(px,t[i])
		add(py,t[i+1])
		if(t[i+1]<my) my=t[i+1]
		if(t[i+1]>xy) xy=t[i+1]
		if(i<#t-2) then
			if(p) fillp(p)
			line(t[i],t[i+1],t[i+2],t[i+3],c)
			fillp()
			--yield()
		end
	end
	--scan down the screen
	for y=my,xy do
		local nx={}
		--build a list of nodes
 	local n=0
 	local j=pc
 	for i=1,pc do
 		if((py[i]<y and py[j]>=y)
 			or(py[j]<y and py[i]>=y)) then
 			add(nx,(px[i]+(y-py[i])/(py[j]-py[i])*(px[j]-px[i])))
 		end
 		j=i
 	end
 	--bubblesort nodes
 	local k=1
 	while(k<#nx) do
 		if(nx[k]>nx[k+1]) then
 			nx[k],nx[k+1]=nx[k+1],nx[k]
 			if(k>1) then
 				k-=1
 			end
 		else
 			k+=1
 		end
 	end
 	--fill the pixels
 	for l=1,#nx-1,2 do
 		local d=nx[l]
 		local e=nx[l+1]
 		if(d>=127) break
 		if(e>0) then
 			if(d<0) d=0
 			if(e>127) e=127
 			if(p) fillp(p)
 			line(d,y,e,y,c)
 			fillp()
 		end
 	end
 end
 --yield()
end

[ Continue Reading.. ]

31
9 comments


Cart #hilda-1 | 2019-02-17 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
18

The game is a work in progress, but is mechanically complete. Just adding levels and polish at this point.

EDIT: I've got 6 levels so far. I'm going for maybe 10-15, and then I want to add some more SFX and music.

18
7 comments


Modified previous work to add a centroid bar to spiral galaxies.
https://en.wikipedia.org/wiki/Barred_spiral_galaxy

Press: "x" to regenerate.

Cart #galaxy_generator-3 | 2019-02-02 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
4

4
0 comments


Cart #rupiwpge-0 | 2019-02-02 | Code ▽ | Embed ▽ | No License
4

This is a work in progress randomly generated marble game. I have to shout out Eggnog, who made the excellent game PicoPutt. You should go play that, this game is only possible because of his excellent collision methods, and it's not nearly as good.

4
1 comment


Cart #zapemediwa-0 | 2019-02-02 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

1 comment


Cart #adpz-0 | 2019-02-01 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
3

It's an implementation in pico-8 of the famous puzzle game,
with one of the most beloved rulesets amongst the game's enthusiasts.

WIP.

3
6 comments


Today I am starting a new tutorial series on how to make a Roguelike in Pico-8. New episodes will be released throughout February. Hopefully, we will be done before the 7-Day Roguelike Challenge 2019 begins. The series is designed to give you the skills and tools to participate in that challenge.

If you have any questions of feedback you can post them in this thread.

Here is the full playlist

Here are the videos:

#2 - Basic Movement

[ Continue Reading.. ]

67
18 comments


Cart #flowerhead-1 | 2019-02-07 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
8

A difficult platforming game with a gardening/Splatoon-like twist. Made by Charlie Tran

This is one of my first games, and my longest to date. Please let me know what you think, thanks!

8
8 comments


Cart #salahachider-3 | 2022-09-28 | Code ▽ | Embed ▽ | No License
7


The STG like "LIFE FORCE".
Japanese title is "沙羅曼蛇".

I refferred to Family computer ver.

Main game is WIP.

  • ver 0.04:
    • Adjusted for PICO-8 0.2.5.
    • Title rendering no longer causes a processing drop.
    • Two fighters now appear.
    • Self-destruct.
  • ver 0.03: Stabilize sfx.(using music())
  • ver 0.02: Can shot the bullet. Power up, The players remaining number UI.
  • ver 0.01: Release.
7
5 comments


Cart #lighthouse-0 | 2019-02-01 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
4

A tweetcart I made to teach myself what sin() and cos() actually do. I never took trigonometry.

4
1 comment


Cart #picochallenge-0 | 2019-02-01 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2

A demake of my game Patrick's Cyberpunk Challenge for the TweetTweetJam.

The object of the game is to move Patrick the Leprechaun around the board and remove all 28 squares. Squares with special symbols will remove extra squares:

Move Patrick to a square using the arrow keys. Note that you can (and sometimes must) move diagonally by pressing two arrow keys simultaneously.

Puzzles might be impossible to solve, and the game doesn't recognize if you win or lose. If the screen is empty except for Patrick, you win! If you have no legal moves, you lose and must restart the game manually.

[ Continue Reading.. ]

2
5 comments


Not a big problem, but probably easy to fix.

If you're in the sprite editor and press Alt+Left to go to the code editor, the cursor will move one space to the left.

The same happens if you're in the music editor and press Alt+Right; the cursor will move to the right.

1 comment


Here's a strange bug I found. If you write something like this in the code editor:

rectfill(0,0,5,5)

and you search for 0 with CTRL+F, it will highlight the first 0. If you then press CTRL+G, however, it will fail to find the second one. The same goes for the 5.

From my testing, this seems to only happen with every other occurence. If you search for 0 here:

rectfill(0,0,0,0)

then CTRL+G will only highlight the first and the third argument.

I've only had it happen with function arguments, and only with single-character arguments; single-letter variable names also have this problem. Putting a space after the commas also makes it behave properly.

It's a bit of a problem when writing tweetcarts where you have little whitespace, short variable names, and want to find variables or number literals to replace while optimizing :)

1 comment


Cart #dihobzifo-0 | 2019-01-31 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

0 comments


Cart #sunrise-0 | 2019-01-31 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
8

Tweetcart, 272 chars.

Grid based on tweetcart by @electricgryphon.

8
7 comments


Cart #moon_rises-1 | 2019-02-02 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1

Originally from Tobiasvl's tweetcart: https://twitter.com/Spug/status/1090559155436511232

(Sorry I didn't include the link before.)

1
2 comments


Cart #yazezakohu-0 | 2019-01-31 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1

WIP version of a little roguelike I'm working on.
Sprites are based on Scroll-o-Sprites by Quale-Art.

You are THE BOY and you have entered the DIRE DUNGEON in search of treasure and glory!

Currently, v0.1 only features character and camera movement.

1
0 comments


Cart #jrs_jellyup-0 | 2019-01-31 | Code ▽ | Embed ▽ | No License
9

This is Jelly Up! Help our little jelly friend to get to the surface by grabbing oxygen bubbles while dodging enemies.

9
6 comments


Cart #headbangers-0 | 2019-01-31 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2

This was totally a bug but I decided to add Back In Black and some beers.

Enjoy !

2
1 comment


this nifty code lets you debug your project. Features it provides are in the codes guide on how to use it~

Cart #superdebug-0 | 2019-01-31 | Code ▽ | Embed ▽ | No License
4

--super debug v 1.0
--shooting★

--[[
…………………………………………
      how-to use
…………………………………………
to use this code, check out tab
2 and copy the compressed code.
once its coppied, you'll need
to put "sdbg()" (without
quotes) inside of your
_draw() function, at the very
bottom. make sure its drawn
last.

by default, the key to display
debug info is the tilde key (
the ` next to the number 1 on
standard u.s keyboards). you
can change this by simply
changing dbg_dbtn. at your init,
you can put dbg_dbtn = 't' for
example, and then 't' on your
keyboard will open the debug
info.

if you want to adjust the
memory location, you can adjust
the variable called addr.
by default, its 0x5e00. to edit
it, do the same as editing
dbg_dbtn, just put it in
_init(). ( addr = 0x5e01 )
…………………………………………
      ★features★
…………………………………………
this code displays the following
information:
 ◆ framerate
 				(top-right)
  ………
 ◆ cpu usage
  ………
 ◆ mem usage/max mem
  ………
 ◆ test count
 				(how many times
    	you tested your project
    	since installing this code)
  ………
 ◆ mouse info
 				(location, click
    	#)
  ………
 ◆ tile flags & id
 				(displays all 8 flags on the tile
    	you're hovering over)
  ………
 ◆ color of hovering-pixel
 				(gets the color of the
 				pixel you're currently
 				hovering the mouse over.)
  ………
 ◆pico version
	 ………
 ◆ uptime
     (how long the test has
     been running for)
  ………
]]

Alternatively, you can copy the compressed code directly and just follow instructions from the code displayed above. here's the compressed code that makes the entire thing run.

--code
dbg_dbtn = '`' dbt = 7 don = false cc = 8 mc = 15 addr = 0x5e00 function dtxt(txt,x,y,c) print(txt, x,y+1,1) print(txt,x,y,c) end function init_dbg() poke(0x5f2d, 1) test_num = peek(∧addr) or 0 poke(∧addr, test_num+1) end dbtm = 0 dbu = {0,0,0} function sdbg() if stat(31) == dbg_dbtn then if don==false then don=true else don=false end end if don != true then return end local c=dbt local cpu=stat(1)*100 local mem=(stat(0)/100)/10*32 local fps=stat(7) local u=stat(7)..'' local _x=124-(#u*4) local du = {dbu

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




Top    Load More Posts ->