Log In  

BBS > Community Superblog
All | Following | GIFs | Off-site

Probably everyone has one of these... sharing in case you don't and need a quick wrapper around the mouse support.
The library implements an OOP like MOUSE object that supports 2 buttons and provides the following methods:

  • enable() : Enables mouse suport
  • disable() : Disables mouse support
  • pressed(<num>) : true/false if button number <num> is pressed in current frame
  • clicked(<num>) : true/false if button number <num> is pressed in current frame but was not in the previous
  • released(<num>) : true/false if button number <num> is not pressed but was in the previous frame
  • inside(minx,miny,maxx,maxy) : true/false if mouse is inside the defined rect boundaries

Would be quite easy to extend, mouse cursor can be set to any spritesheet index and would be easy to handle animated cursors, bigger cursors and such...

The demo cart shows how it behaves... pressing buttons changes background color, clicking and releasing draw some points on the screen (in green hues for btn 1, blue hues for btn 2.. brighter for click, darker for release)

[ Continue Reading.. ]

3
0 comments


Cart #jinujuyufo-1 | 2020-07-19 | Code ▽ | Embed ▽ | No License
11

"Basement" is an exploration-based platformer in which the main threat is fall damage and the main challenge is finding safe paths through each section. I consider the quotation marks as part of the title. The game takes place in the caverns underneath a magical castle and includes several interconnected areas which can be explored in various orders. In addition, there are extra things to find that result in bonus dialogue.

I tried to design the game in such a way as to not need to explain how anything works. In addition, the difficulty curve is based on the idea of harder sections being harder to find. The ways to get to areas other than the first one all require some trick that the player can learn in a different area, thus forming a progression that is intended to be similar to a metroidvania, but with the upgrades occurring in the player rather than the player character.

[ Continue Reading.. ]

11
4 comments


Work in progress. Feel free to leave any feedback.

Cart #foweriteri-0 | 2020-07-19 | Code ▽ | Embed ▽ | No License
3

3
1 comment


chill, watch the waves, it's a beautiful evening

Cart #nightsea-0 | 2020-07-18 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
8

8
1 comment


Hi, I'm practicing how to do object oriented programming in PICO-8 but struggling a bit to map things in my head between OO design and actual game code. My practice project is doing MBoffin's top-down game tutorial with an OO approach but my long term goal is to do either a top-down adventure/rpg (=Zelda) or turn-based strategy (=UFO X-COM).

The reason I want to do OOP is my Java dev background and also personally I don't like procedural code, it feels so messy and cluttered. I'd like to have the behaviour and presentation of an entity in its class instead of spread around the application but that's the difficult part for me at the moment.

Bunch of questions:

  • Is there any point of doing a class for a singleton entity, eg. player actor? As my player1 object will be the only instance I could as well have that and not bother with the prototype. Now I have something like this:
-- prototype
player = {}
function player:new(o)
  local o = o or {}
  setmetatable(o, self)

[ [size=16][color=#ffaabb] [ Continue Reading.. ] [/color][/size] ](/bbs/?pid=79575#p)
1
5 comments


I'm currently working on a game that uses strings to store maps, switching them out on the fly. I noticed during debugging that I'd forgotten to flag some of the sprites as walls, so I stopped the run to go fix that, then tried to resume. Upon using the "resume" command, I found the map had reverted to the one I currently have as default.

I put this in the "bugs" category because I didn't see a more appropriate one. I'm not sure if this is something that should be changed. However, it's not mentioned in the manual, nor on the wiki, and I think it should be mentioned in both.

If not too difficult, it would also be useful to allow specifying what behavior "resume" should have.

2
1 comment


Hey everyone. I recently released Goober's in the Mix. It was my first bigger pico game that actually required me to optimize for tokens. I wrote a lot of pseudo object oriented code with classes and inheritance. I found myself with a lot of code that looked like this:

local thing = class{
   update = function(self)
      -- cache a bunch of properties
      local x, y, dx, dy, health, frozen, invuln = self.x, self.y, self.dx, self.dy, self.health, self.frozen
      ... game logic in here
      -- resync all those properties on the instance
      self.x, self.y, self.dx, self.dy, self.health, self.frozen, self.invuln = x, y, dx, dy, health, frozen
   end
}

All that caching and syncing saves tokens instead of referencing self in the logic, but we can save more.

Lua has a feature called environments that lets you alter how global variables are looked up. So I altered my initial class declaration to look something like:

[ Continue Reading.. ]

15
6 comments


Cart #jipahefofu-0 | 2020-07-18 | Code ▽ | Embed ▽ | No License

This cart is made by Alex McCulloch.

0 comments


Cart #bug_smash-0 | 2020-07-17 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
7

"It's a gory version of the Mario Paint game with a chill sound track. Very hip."
u/TheRedBeed from r/pico8

Smash bugs with Z, move with arrow keys.
To start the game, smash the bug!

Player 2 can join and play at anytime. The game gets slightly more unforgiving with a second player, to compensate.

You can hold down the buttons to move faster and to smash repeatedly or you can tap them to be more precise.
Smashing multiple bugs in a streak without missing gives you bonus points, but it takes more time.
Be it button mashing or attacking with precision, get rid of all the bugs!

Coins give you some points.
Clocks give you some points and more time.

[ Continue Reading.. ]

7
4 comments


Cart #bizohuruna-0 | 2020-07-17 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

just trying out the small project in picozine 1!

0 comments


Cart #rle_demo-4 | 2020-07-21 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
9

I needed a way to display graphics without using sprites/ or tiles.
So I wrote a small python script that takes an 128x128 image, finds the best matching colors from either the normal or secret palette (or the best 16 colors of both) and stores that in a data string.

If there's interest I can share the python code - main reason I haven't done so is, that I haven't made he python script user friendly :)

No sprites used in this demo.

You can download the image -> string conversion tool and some example code here:
https://github.com/iSpellcaster/pico8rle

9
24 comments


Cart #gravitaz-2 | 2022-08-04 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
10

Hey all!

Here's a project I started about two years ago and just finally got around to finishing. It's a simple Shmup reminiscent of a Galaga or an Invaders, but with a few fun twists.

Featuring:

-Six enemy classes with unique weapons
-Randomized waves
-Shop system

-New in Version 1.1:
--Bossfights!
--Music
--Persistent Highscores
--General Bugfixes

If you want to download a standalone game, it can be found for free over at https://kepler-softworks.itch.io/gravitaz

I also have a short video talking about some parts of the code (enemy logic and the particle system) a bit over on my Youtube channel at https://www.youtube.com/watch?v=IVEEdj82Biw

Feel free to rip out the particle system and use it in your own projects, I really enjoyed using it, and I think with a bit of modification, it could be expanded upon for a lot of other things.

I hope you all enjoy this little game, I know I enjoyed making it, and let me know what your high scores are!

Edit Aug 4, 2022

Decided to come back to the game and try and improve it a bit. Still a few things I'm not super happy with, so there might be a version 1.3 eventually.

-New in Version 1.2:
--Better logo!
--New Space Dust!
--Stars are less distracting now!

10
3 comments


Hey Team,

I'm new to Pico 8 as of about a month ago, and just made a super simple game as a joke for a friend. I exported the html and js and posted it on itch.io, but when I'm using Firefox, about 75% of the time the player seems to think that the pause button and the x button are being pressed constantly. It works great on Chrome, so it's something specific to how Firefox is interpreting the code. I would love some insight, if anyone has any ideas.

Here is a link to the game: https://keithamhere.itch.io/echonest-the-game?secret=LlU4RobXGkyakrhjhWze4J9wTQ

Thanks!

2 comments


I wanted to create background images w/o having to use tiles/sprites for that.
So I'm wroting a small python script, that takes a 128x128 png, reduces it to the most commonly 16 used colors from the pico8 palette, does RLE encoding on them and outputs the values as a string.

This string can then be imported into pic8 and used to render your background image.

The python part is not yet perfect (I need to write the custom palette generation code), but if you limit it to one of the two pals, it kinda works.

End even when re-drawing the bg from the data every frame, it's kinda ok.

The encoder and the functions to use the result can now be found at: https://github.com/iSpellcaster/pico8rle

Here's the code of the latest version.
Includes base64 encoded of variable sized sprites than can be flipped. Should run after copy and paste, nothing else required.
To encode your own images, check the github link above.

function _init()
 state  = "title"
	title = explode64(kanji_rle)
 batman= explode64(bat_rle)
 antiriad = explode64(antiriad_title_rle)
 ryu=explode64(ryu_rle)
 t=0
 _draw = draw_title
 start_t = time()
end

function _update()
	t+=1
 if btnp(❎) then
 	if state == "title" then
 		_draw= draw_batman
 		setpal(bat_pal)
 		state="batman"
 	elseif state == "batman" then
 	 _draw= draw_antiriad
   state = "antiriad"
 	 start_t = time()
 	 pal2()
  else
   _draw= draw_title
   state = "title"
 	 start_t = time()
 	 pal()
		end
 end
end

function draw_title()
 local i,ofs,y
 ofs = flr((time()-start_t)*45)
 ofs2= flr((time()-start_t)*2)
 --rectfill(0,0,127,127,ofs2%4) 
 cls()
	y = ofs%250-100
	if y > -127 then
		spr_rle(title,(128-title

[ [size=16][color=#ffaabb] [ Continue Reading.. ] [/color][/size] ](/bbs/?pid=79494#p)
17
42 comments


Greetings Everyone!

I've been thinking to do a cool project for my school. I want to create a 128 x 128 LED wall display of 1 to 2 meters diagonally. I've been looking at DIY one with LED Strips or LED Matrix (ws2812b type). I think a raspberry pi can drive the display and also run the Pico-8 player software (only for playing, the editor is not needed). So far I have no idea how to do this. I know how to solder and wire the LED but they seem very expensive.

The idea is to have a giant screen outside for students to play. We can use a camera (maybe a raspberry pi 4 can also due the video AI analysis) to detect the student's movement as d-pad and buttons input. We can have a sort of QR code that will redirect students to a webpage for them to upload their game cartridges (will have to manually approve them to avoid strange things displaying on the screen publicly). This will promote students to start coding in order to play their games on the big screen.

I'm a 5th grade science and math teacher but I'm also an Electrical Engineer with a minor in robotics and automation.

[ Continue Reading.. ]

4
7 comments


I've just kinda been playing around and suddenly I felt like doing something with fractals. I saw a few Lindenmayer system tools posted on here, but they didn't quite have the features I wanted. (If you'd like more, you could suggest some too.)

The first line is the starting state, the second and third are replacement rules, the fourth is your palette of symbols plus a couple settings.
… is blank, ⬅️➡️ are rotation, ˇ∧웃 are variables that move the cursor forward, ●♥♪ are variables that don't.
O and X both work as confirm buttons, but also increment and decrement the iteration and angle numbers.
The pause menu lets you change the step length or cycle through a few presets.

Cart #fafapemado-2 | 2020-07-20 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
3

[ Continue Reading.. ]

3
0 comments


Some things that might be useful.

Dark palette

Usage:
l: how strong the darkness effect should be

dpal={0,1,1,2,1,13,6,2,4,9,3,13,5,2,9}
function dark(l)
 l=l or 0
 if l>0 then
  for i=0,15 do
   col=dpal[i] or 0
   for a=1,l-0.5 do
    col=dpal[col]
   end
   pal(i,col)
  end
 end
end

Circle map

Usage:
x,y: coordinates to draw the map
r: radius of the map to draw

function circmap(x,y,r)
 for y2=-r,r do
  x2=sqrt(abs(y2*y2-r*r))
  tline(x-x2,y+y2,x+x2,y+y2,(x-x2)/8,(y+y2)/8)
 end
end

Can be used with dark palette to make a light:

[hidden]

-- circle map function
function circmap(x,y,r)
	for y2=-r,r do
		x2=sqrt(abs(y2*y2-r*r))
		tline(x-x2,y+y2,x+x2,y+y2,(x-x2)/8,(y+y2)/8)
	end
end

-- function to darken the palette
function dark(l)
	l=l or 0
	if l>0 then
		for i=0,15 do
			col=dpal[i] or 0
			for a=1,l-0.5 do
				col=dpal[col]
			end
			pal(i,col)
		end
	end
end

function _init()

	-- dark palette
	dpal={0,1,1,2,1,13,6,2,4,9,3,13,5,2,9}

	t=0
	x=64
	y=64
	r=32
end

function _update()

	-- circle position and size
	x=64+sin(t/100)*32
	y=64+cos(t/100)*32
	r=32+sin(t/50)*16

	-- timer and loop
	t+=1

end

function _draw()

	cls()

	-- darkens the palette 2 times
	dark(2)

	-- draws map
	map()

	-- resets palette
	pal()

	-- draws circmap
	circmap(x,y,r)

end

[ Continue Reading.. ]

20
8 comments


my very first attempt at making a pico-8 game that isnt just some random garbage. lots of this follows a tutorial, but a lot of it doesnt either. maybe i'll add in enemies or collectables at some point but for now this is mostly finished


2
0 comments



This is just a music cart I made to learn the music editor. It was very interesting to learn how the music editor works. Now, I want to get better at this and make more music covers in the future.

2
5 comments


Cart #wojkunadu-1 | 2020-07-17 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
6

Hey, I'm Triple.

This is my first Pico-8 cartridge! It was fun experimenting and creating it.

It's a clone of 'Ice Fishing' on Club Penguin.
In this game, you have to reel in 32 fish while avoiding sharks from eating your hook and crabs cutting your line.
You can also decide to save your final fish to catch Mullet, the larger fish.

I know the game is a bit rough around the edges. There is still so much more for me to learn and improve on. Constructive comments are appreciated!

-- Changes

I implemented some of the feedback into the game:
> Added some animations for reeling in the fishes.
> The fishes move a bit slower now

--

Thank you for the feedback, and thanks for playing my game!

6
7 comments




Top    Load More Posts ->