Log In  

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

Day night cycle

Hi! I made a function to add a day night cycle. It shifts the palette and takes two arguments, hour and minutes. The palettes can be modified.

First you can see it in action here:

Thing to note

  • The night palette is very different from the rest, adjust it based on your sprites. Originally this palette was made by Achie72
  • It is very token intensive at the moment. That can surely be optimized by either cleverly contstructing the palettes at runtime or deleting those you don't use. But I kept it like this for readabilities sake.
  • Maybe adjust the time to your needs. I took a shorter day as a model but you could also change the times(ho=hour in the function) in code
function set_pal(h,m)
local pals={
--night palette from achiegamedev - thx ♥
{[0]=0,129,130,131,132,133,5,13,2,4,137,3,1,141,136,143},
--regular second palette
{[0]=128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143},

[ [size=16][color=#ffaabb] [ Continue Reading.. ] [/color][/size] ](/bbs/?pid=129023#p)
6
0 comments


Cart #medibot_bash_wip1-2 | 2023-05-02 | Code ▽ | Embed ▽ | No License
2

Medibot bash aka 'Golden Cudgel'

Recent reports of a Chinese woman apparently seeking help at a hospital (her expressions of frustration, at having pre-assessment performed by a robot) inspired an early morning effort to mash something together..

Partially pulling from some of my previous prototypes - (perhaps passing some problems with the newer pico 8 web export format).

tech notes: Just basic draw order rules/collision and rough looping animation at this stage. I would like to control the length/speed of the animation loop and corresponding sounds, suggestions with this or various methods to avoid obvious sfx clipping (ie how to execute as 'oneshot') are appreciated.

2
0 comments


Cart #rubikscube-1 | 2023-04-25 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
14

RUBIK'S CUBE

CONTROLS :

Moving Around !

Use the (↑) (↓) (←) (→) Arrow Key to move around the cube.
you can invert the control in the option menu.

Selecting / Unselecting faces !

Use (O) to select a face, the selected face will be Highlighted and
3 move option will appear.
Use (O) again to unselect the face.

Rotate faces !

Once you have selected a face, Use the Arrow Key to rotate the face.
Use the (←) Arrow Key to turn 90° counter clockwise
Use the (→) Arrow Key to turn 90° clockwise
Use the (↑) and (↓) Arrow Key to turn 180°

[ Continue Reading.. ]

14
2 comments


Cart #vvintner-0 | 2023-04-25 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
5

VAMPIRE WINEBAR!

It's here! The sequel to Kobold Blender Tycoon. Your Kobold Blender has been replaced with a syringe and your craving for kobold meat has been replaced with finer (and redder) tastes. Grow green grapes and red grapes and turn the lights off and on. (as your skin is light-sensitive)

Be careful how many people you turn, as the local demographics are simulated at a level that would surprise you.

Can you achieve 3-stars on Vampire Yelp?

5
2 comments


This is some code I wrote to nicely stringify tables. This code started life as a printh() replacement that output directly to the console, but I rewrote it as seen below so it can be used in other contexts.

The strngfy() function can produce either indented, multi-line code, or single-line compact output. Both scalar values and tables are supported as both keys and values.

The rptsp() and tcnt() functions are support functions used by strngfy(), but they also have utility as stand-alone functions.

The code is probably not particularly elegant, but it works for the scenarios I tested. There are some comments in the code to help users get started. All lines fit within the line-width of Pico-8's built-in editor.

The code is 238 tokens.

I'm new to both Pico-8 and Lua, so if I did something the hard way, or missed some tricks, or if you find bugs, let me know.

Updates

  • 04/25/2023
    • Updated function to format function types in table
  • 04/30/2023
    • Same thing for booleans. Code is now 246 tokens.

[ Continue Reading.. ]

2
1 comment


function _init()
	chosen = 1
	mode = "menu"
	level = 1
	selx = 64
	sely = 64
	sinceshot = 0
	shotx = 64
	shoty = 64
	cls()
end

function _update()

	cls()
	if mode=="menu" then
		if chosen==16 then
			print("no-scope mode?! 16 ⬆️/⬇️/🅾️", 1, 1, 11)
			print("(x, y) will be provided instead", 1, 10, 7)
			print("warning: extremely difficult!", 1, 19, 8)
		else
			if chosen>10 then
				print("novelty crosshair " .. tostr(chosen) .. " ⬆️/⬇️/🅾️", 1, 1, 10)
			else
				print("crosshair " .. tostr(chosen) .. " ⬆️/⬇️/🅾️", 1, 1, 6)
			end	
		end
		spr((chosen - 1), 60, 60)

		if btnp(🅾️) then mode = "game" end
		if btnp(⬆️) then chosen += 1 end
		if btnp(⬇️) then chosen -= 1 end
		if chosen>16 then chosen = 16 end
		if chosen<1 then chosen = 1 end

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


Cart #simple_adventure_prototype-0 | 2023-04-24 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2


First playable thing I've made on Pico-8 other than fizzbuzz etc. Thanks to the Lazy Devs youtube channel for the nice and comprehensible tutorials!

2
0 comments


Cart #faithreason-0 | 2023-04-24 | Code ▽ | Embed ▽ | No License
6

6
6 comments


Cart #knutil_exrect-1 | 2024-12-24 | Code ▽ | Embed ▽ | No License
1

Feature Overview

EXRECT() creates a rectangle object with extended functionality.

  • The created rectangle object can be drawn and its inclusions and overlaps can be checked.
  • Drawing and update functions return their own objects, so they can be written in succession.
  • This function consumes 396 Token.(include comb() and cat() functions)
r = exrect('10 80 16 24') -- generate a rectangle object from a string. x:10, y:10, width:16, height:24
r.rf(6).rs(7) -- draw "r" with rectfill, and then draw it again with rect.

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


Cart #lawnmowingmayhem3-0 | 2023-04-26 | Code ▽ | Embed ▽ | No License
7

LAWNMOWING MAYHEM 3.0.0

In this game, you need to cut your grass, and QUICK!
Avoid mowing over the flowers, get all the grass, and get the highest score possible!
If you run out of time, you lose.

Controls and scoring information are in the game, but here are the controls and scoring information anyway ;)

Controls:
Up/Down/Left/Right: Move
X: Turn around
O: Turn lawn mower on and off

Scoring:
Mow tall grass: +10
Mow already cut grass: -5
Mow flowers: -20
Remaining time gets added to score at end.

Rocks:
If you put your mower on rocks without turning it of, it's game over!

Water:
You can't walk on water, but if you try to push your mower into the water, its also game over!

[ Continue Reading.. ]

7
6 comments


function _init()
	chosen = 1
	cls()
end

function _update()

	cls()
	if chosen==16 then
		print("no-scope mode activated! 🅾️", 12, 1, 11)
	else
		if chosen>9 then
			print("novelty crosshair " .. tostr(chosen) .. " ⬆️/⬇️/🅾️", 1, 1, 10)
		else
			print("crosshair " .. tostr(chosen) .. " ⬆️/⬇️/🅾️", 1, 1, 6)
		end	
	end
	spr((chosen - 1), 60, 60)

	if btnp(⬆️) then chosen += 1 end
	if btnp(⬇️) then chosen -= 1 end
	if chosen>16 then chosen = 16 end
	if chosen<1 then chosen = 1 end

	end
end

With this code, I'm receiving an error at line 23:

SYNTAX ERROR LINE 23 (TAB 0)
 IF CHOSEN<1 THEN CHOSEN = 1 END
<EOF> EXPECTED NEAR END

Isn't the END the EOF?

Note: Edited due to a misspelling. Original:

SYNTAX ERROR LINE 23 (TAB 0)
 IF CHOSEN<1 THEN CHOSEN = 1 END
<EOF> EXPECTED NEAR END
4 comments


Cart #amongus2-4 | 2023-04-24 | Code ▽ | Embed ▽ | No License
12


<- and -> to move
Z to jump
X to interact

The long awaited sequel to Among Us... Among Us 2: Rise of the Attack of the Imposter with a Vengeance: 2: The Second One!!

You find yourself on a spaceship full of your fellow crewmates. The Among Us lobbyists require you to complete 7 tasks before you can enter the meeting room. Management suspects somebody is an imposter, sent here to kill us and prevent us from doing tasks! How will we make enough profit to impress our shareholders with an imposter among us?!?!?! Jump your way through difficult platforming challenges to claim your task dog-tags and prove to Big Among Us that you have what it takes to climb the corporate ladder!

[ Continue Reading.. ]

12
2 comments


Cart #bugs-0 | 2023-04-23 | Code ▽ | Embed ▽ | No License

3 comments


Cart #clickclickclickclick-0 | 2023-04-23 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2

2
4 comments


Cart #pixil_massacre-1 | 2023-04-22 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
6


Cart #pixil_massacre-0 | 2023-04-22 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
6

pixil_massacre

My First Game! Just a fun little arcade game where you can level up your weapons and shoot the escaping prisoners before they get out.

Controls

X to shoot and O to throw grenades
Enter and Exit the shop with X in the bottom right
Items in the shop cost kills
Each enemy that leaves the screen loses one life until you lose

[ Continue Reading.. ]

6
1 comment


Cart #gonowabiku-0 | 2023-04-22 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
3

This is a simple game demonstrating the Orographic effect. Go high enough and your rain starts to fall. Let it rain for a while on some tiles and plants will grow.

Controls: Movement arrows.

3
0 comments


Cart #istillwannadie-0 | 2023-04-22 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
3

3
0 comments


I just bought a license for Pico-8 via itch.io, was wondering if there was any way to link that here or not? I only see options for Humble Bundle.

4 comments


Cart #shooter_game1point1-1 | 2023-04-29 | Code ▽ | Embed ▽ | No License
4


top down simple shooter game made in 2 days

4
1 comment


Cart #cloudgenerator-0 | 2023-04-22 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
5

Cloud generator 1

Procedural cloud generator using a lot of circles and fill patterns.
I tried to comment the code as well as possible and make it as readable as I could.
It's not a very complicated piece of code, but I know by now that trying to decipher someone else's code isn't always easy.

room for improvement

  • Not all generated clouds look great
  • If you start playing around with the arguments in the function, it can be tricky to get it to look the way you want.
  • There is also no easy way to change the colors of the clouds.
  • The circles get smaller the higher up on the screen, but this is based on the absolute y-coordinate of each circle. This means that if you put your clouds lower on screen with the "topy" argument, the radius off all circles gets bigger. The fact that one argument affects multiple things makes the look of the clouds harder to control.
  • The darker and lighter colors are randomly picked, it would be nicer if the base of the cloud was always a little darker then the top of the cloud
  • It could use some more vertical randomness, now it is like a single roll of evenly thick cloud and it gets worse when you increase the density.

Implementing these improvements would probably cost more tokens though.

5
0 comments




Top    Load More Posts ->