I am working on a 3D raycaster game. It's largely working; see the gif below:
I am basically using zep's cast demo as a starter - if you look through my code you will see his draw_3d() function, albeit pretty heavily hacked at this point. I use tline() to draw my walls, and i apply a fillp() based on distance from the camera to get a (currently ugly) dithered lighting effect.
I would like to do the same thing for my floors! Except, I am drawing my floors vertically. See the next gif:
I only draw a floor (vertical line() downward) if my casted ray hits a wall OR a new tile type (thats how i get different floor colors).
Anyone have a cpu-conservative tip for how I could get a gradient similar to my walls on the floor? I COULD draw the floors first as a flood-fill, but this would ignore different colors and elevations. I can't think of any way to apply a smart horizontal-fill strategy, which would allow me to apply fillp() based on distance from the camera.
Here's the current cart, if anyone is interested:
My entry for Toy Box Jam 3, 2022. Help Sally Neptune escape from the evil Monocronies!
- Move: arrow keys
- Shoot and strafe: X. This will strafe if you are not targeting something, and will let you circle-strafe a target.
- Jump: Z or C
- You will need keys to open doors.
- Look for the giant Neptune coin to escape!
- There are gun powerups around that will let your rainbow gun shoot faster. Try to find them all!
I've always wanted to make a game based on the cast.p8 demo, and this is it! I am very happy with how sprite occlusion turned out.
I wrote this game in multiple files, so it may be tough to read in the pico8 editor. When I get a repo up on github, I'll update this in case anyone wants to see how I made this. Enjoy!
WARNING - sudden flashing lights and sounds.
The Greatest Thing
My entry for the ludum dare 48 jam. Go on a pitfall-esque adventure in search of the greatest thing ever.
Arrow keys to move, Z/C jump, X/V carry things.
hotfix1 - fixed softlock in climbing room
hotfix2 - decided not to be a jerk and gave back key repeating by holding a button
Here, I am demonstrating how I typically handle my actor objects when making games using an object-oriented approach. I like all of my game entities (like the player and NPC characters) to be their own objects with methods that are common to them (update and draw being the main needed items).
The snippet here is my starting templet for most of my games. The "Actor" table is my default object. The method "New" can be used for two things:
- creating a subclass which will inherit all properties and methods of actor, unless they are overwritten explicitly
- instantiating the "actor" into the game
If you are looking for a code snippet to get started and you want to use an object oriented approach, I encourage you to give this a try. Thanks!
Myrtle Takes The City
My submission for Toy Box Jam 2019. Thanks to the organizers and content creators for putting together an awesome event!
Myrtle is visiting the big city, and wants to climb city hall! To get in, she needs to collect 7 gems. Maybe there are people in the city who can help?
How to play:
Arrows - walk
action key 1 (x, v) - run
action key 2 (z, c) - jump
There are not fatal hazards in this game, so don't be afraid to walk up to everything.
Feel free to post your best times, for both any % and 100%.
Notes for launcher:
cart name: myrtlecity-0
alias on itchio: Myrtle Takes The City
itchio link: https://paloblancogames.itch.io/myrtle-takes-the-city
Running PICOPi on the Retroflag GPi case
I just got a Retroflag GPi case, which is a cool little enclosure for a Raspberry Pi 0(W) that has the form factor of a GameBoy. This gadget is intended primarily for emulation, but I REALLY wanted to use it as a portable pico-8.
Spoiler alert - I did.
Most tutorials for the GPi case focus on getting RetroPie running, and there are also resources out there for getting pico-8 running in conjunction with RetroPie. This is fine, but I really wanted a gadget that quickly boots into pico-8, no questions asked. Luckily, a software engineer going by Gamaral developed an image for all raspberry pi models that fast-boots into pico-8. This is, to my knowledge, the closest we can get today to dedicated pico-8 hardware.
Goal of this tutorial
This tutorial will focus on getting PICOPi running properly on a raspberry pi 0(W) in conjunction with the GPi case. You can find all of these materials for purchase on most online retailers. There are plenty of tutorials showing how to build the thing once you get all the materials (non-trivial!). I will not cover this.
Physical stuff you need
- Retroflag GPi case
- Raspberry pi 0 (the W model has wifi onboard, but the setup is the same, and it doesn't matter since the picopi image has no widi support anyway)
- SD card formatted to FAT32
Software you need
- Patch files for GPi case http://download.retroflag.com/
- PICOPi download for Raspberry Pi A-B-0
original site is downhttps://github.com/paloblanco/rpi-buildroot/tree/rpi/dist
- Raspberry Pi build of pico-8 (You can get this from the downloads page here on lexaloffle)
What you need to do
NOTE Since I am not sure about the licensing on the code I am linking to, I have opted not to copy-paste the exact code you will be copying around. Trust me, though, it's pretty easy.
DOUBLE NOTE as with all DIY projects, you are taking on the risk yourself in installing all of this software - I am not responsible for any bricked hardware.
- Assemble the GPi case and the Pi 0 (I am not going to help you with this)
- Insert your sd card into a computer (win/linux/mac doesnt matter)
- Follow the PICOPi directions for setting up your SD card
- Here is where things get a tiny bit tricky. Extract the contents of the GPI case patch somewhere on your computer, then navigate to GPi_Case_patch\GPi_Case_patch\patch_files. You should see two items here, config.txt and a directory named "overlays".
- Open config.txt, and copy all the contents of the file to you clipboard. Navigate to your SD card, open config.txt, and paste all of these contents ABOVE all the contents on the SD card. Your config.txt on your sd card should flow like this:
- All text from GPI patch config.txt
- All text from PICOpi config.txt
- In SD\config.txt, navigate to the #OVERCLOCK section, and remove the pound sign from all the overclock specifications. You need these to run pico8 properly
- Copy the overlays directory from the GPi patch, and copy this to the root of your SD card.
- The GPi instructions might have told you to flip the "safe shutdown" switch under the battery cover to "on." We want it "off," since PICOPi already has safe shutdown built in to it.
- Thats it! plug in your sd card and you should be ready to go! I was impressed by how easy this was.
You will need to pull the sd card in and out of the case to load new games, since PICOPi has no wifi support, but that is a small price to pay for the ULTIMATE pico8 handheld. Enjoy!
I made this in about an hour for ld44's jam! Not much to see here, just really wanted to see if I could throw something together that fast.
Arrows to move. Collect booty from the shipwreck. Find a good ship and sale away to paradise.
My best time is 28 seconds (100% completion). Can you beat it?
Ludum Dare entry for this: https://ldjam.com/events/ludum-dare/44/risk-it-all-for-booty
Hungry Harry is back! Help Harry as he travels around the world putting a stop to the mushroom gang!
HOW TO PLAY:
Walk - arrow keys
Jump - Z or C
Lick things - X
High Jump - jump while licking
Long Jump - jump while licking AND holding a direction.
GOAL: Find the portal at the end of each level. Harry will get hungry over time, so make sure to eat enemy mushrooms as well as berries you find sitting around the levels.
Blue mushrooms are tough and can't be licked normally. If you eat a spicy pepper, Harry will turn red-hot for a few seconds. Use this time to eat the blue mushrooms.
If you lick while in the air, Harry can get a little extra boost. By licking on the ground and then jumping soon after, Harry can jump extra high or extra far, depending on whether or not you are holding a direction key down.
See if you can find every present in the game! You can get lots of berries from presents by licking them.
Is Harry too easy for you? Pause the game with ENTER and choose hard mode!
v1.1 - fixed possible softlock in level 2.
v1.2 - made hard mode accessible from menu instead of a weird code noone can do. Fixed some trouble areas.
v1.3 - fixed present count.
Wow! I finally made a finished version of my LD39 game. Overall, I am fairly satisfied with this game, if not super enthused. I had to make many concessions to fit it into the token count. However, it is a surprisingly fully-featured procedural platformer, and it is something I am proud of.
Help Harry escape the procedurally generated caves!
How to play:
Walk and climb - arrow keys
Burp (attack) - X
Jump - Z or C
Dig - down arrow
- Harry will starve if you don't eat mushrooms along the way. Make sure to grab them!
- the caves are randomly generated every game. If you get a tough set of caves, don't be afraid to try again!
- If you get enough mushrooms, a powerup will appear above harry. GRAB THESE! they are they key to running faster, jumping higher, and burping harder!
- when harry digs on flat ground, he will pile up the ground behind him. Use this to build platforms to help you climb higher.
- the escape for each level is at the top, in the middle. If you find a way to break the ceiling, however, you can use that too!
- Your hunger will occur at a faster rate each level. Mushrooms are almost always worth a detour.
- You can jump for quite a while after walking off a ledge. Use this to your advantage!
v1.1 - Oct 31 '17
- added text to harry's intro that points out your burping ability. Non-pico8 players did not know to try pushing X.
- increased frequency factor of mushrooms from 1.5 to 2. SHould make things a bit easier.
Poor Harry! He was taking a nap when the ice broke from under him! Help him climb out of the caves, and make sure he gets enough mushrooms to eat before he starves!
Arrow keys - move
Z - jump
Down - dig a hole
Up - climb most surfaces
I can't believe I finished this in time. It is pretty bare bones, but I am happy with it. I wish I had the time to add in enemies, but there you go.
Here is the link on Ludum Dare's site: https://ldjam.com/events/ludum-dare/39/hungry-harrys-climb
Congrats to everyone who finished LD39!
--edit Aug 1:
I've tried to clear up some confusion for LD39 participants. It is now hopefully clearer that the first level is actually a level that can be beaten. Also, i added a super-jump (hold up and jump) that should help with some of the trickier levels. The super-jump burns food though, so don't go crazy.
I removed the super-jump. This felt against the spirit of ludum dare, in that i was adding an ability after the competition ended. However, i DID fix the level generator so that all levels can be beaten - i feel that this was a bug fix.
-- edit 3
People keep digging through the floor, so I had to hardcode that to be impossible. Fix made for LD participants
*Edit July 28
I've been happy with this little cave-generator that i made. I might want to use some of it for Ludum Dare this weekend, so I am releasing the current code under the creative commons license.
You can try playing it now! it takes a few seconds to generate a level. There is no "win" state currently, but i envision a game where you have to avoid obstacles, collect stuff, and climb to the top of the cave.
I am using the algorithm i describe below, with a few improvements. If the cave that gets generated is "empty," which would make it impossible to climb, the algorithm will stick some bridges and ladders to climb into the structure. This process is dynamic, so if the cave is dense fewer will generate. Likewise, if you have a very dense cave, there is a safety-check that will make sure the cave can be completed by punching holes through blockages.
If you are interested in using some of this code and have questions, please let me know. The level-generation is almost entirely separate from the character code, so you can choose one or the other. If you are interested, I recommend looking at the callback functions (_init, _update60, and _draw) to understand the basic flow first. There is a lot of code here, about 3500 tokens, but most of it is lumped in the level generation and can be kept as is.
I imagine this being useful for quickly banging out a metroidvania or something along those lines. I hope you enjoy!
I recently started making a little game about a critter who falls into a cave and has to climb out. I wanted to create a big world, but I didn't want to actually design it, so i wrote a little script to generate a large cave-like structure.
The algorithm is pretty slow - it is based on a paper i read in grad school (but cannot remember) for modeling the nucleation and growth of particles in solution. I start with an empty space (64x128 array of zeros) and first create walls by making all of the border values 1. Then, I 'seed' the space by randomly selecting a fraction of the array locations and setting them to 1. I then run a kinetic-monte-carlo simulation. Every step, every single '1' in the array a small chance that it will attempt to move 1 space in a random direction. In chemistry, this represents the random movements small particles or even molecules will make in solution, brownian motion.
If a '1' element in the array is next to another '1', a stickiness factor is applied, making it harder for the element to move away - this encourages the growth of clusters. it is possible to modify this stickiness factor to create more spherical shapes, long shapes, etc. I could also seed the space with regular shapes like boxes or lines and use this algorithm to make them appear more organic.
Anyways, in the demo above, you can watch the simulation run - as it runs, you can see clusters forming. It usually takes me about 4000 frames before the level looks nice (i need to speed up the code!). There's actually a game here too - press z to hop into the caves and explore!
I cooked this up pretty quickly, and I really like how it looks. I will definitely flesh this out into a full game, but I thought this was a fun little demo so I decided to share.
9HOLE is a platformer where you are also golfing! Hit the ball to the hole (under par!) and then get to the hole yourself!
X: Swing your club (hold the button for a harder swing!)
WHEN THE BALL IS AIRBORN:
Arrows: Move the ball (a little bit!)
C,Z: releas ball control and control the character again.
SECRET: if you find the game a little easy, try pressing "Up" repeatedly on the title screen!
I will be doing more of a post-mortem in a bit, but I wanted to get this game online. Happy playing!
- added tutorial text to level 1
- fixed (hopefully!) spraying particles when your ball sits next to a wall
- increased particle counts and lifetimes across the board (makes the game a little flashier)
- fixed level 2 so that there is no point of no return
- adjusted a jump on level 5 so it is a little more forgiving
in the future:
- bug fixes as they get reported
- I would like to flesh out the music with one more layer
- ...that's it? I kind of feel like I've explored this idea to my content.
Directions for 9Hole, a golfing-platformer.
Arrows to move
Button 3 (C or Z) to jump
Button 4 (X) to swing your club. Hold the button and release for a stronger swing!
When the ball is airborn:
- arrows to influence its movement (VERY important) - arrows have more effect after the ball has bounced off something
- press jump to return control to the player before the ball starts moving
Goal: Get the ball to the flag under par, then get yourself there in one piece!
I really, REALLY wanted to wrap this game up, but due to events in my personal life coming up I may not get a chance to finish this anytime soon. I really wanted to share what I have, so here is my first game, 9Hole!
It is heavily a work in progress, and it is missing:
-all sorts of polish
I am really enjoying Pico-8, and it is a testament to the quality of the console that I was able to bang this out in a few free hours (I estimate I've played with Pico-8 about 10 hours total, from downloading to publishing).
One day soon, I hope to finish this. In the meantime, I could use your feedback!
I wanted to make a golf game that didn't involve a timing-based swing mechanic. There is some timing here, but the ball is really controlled well with the arrow keys. It can collect powerups, beat-up turtles, and bounce off springs! I was a little inspired by an old Itchy-and-Scratchy Gameboy game where you platformed and played minigolf. I think the golfing in my game is harder, but the platforming is very simple right now.
Thanks to everyone who has been fooling around here - I have been very inspired by everyone's creations!