I feel like explaining this game would subtract from it. So I'll just say... It's Brainmaze!
Feedback and thoughts would be appreciated! :)
1.0.1 update - made particularly tricky jump near end easier. I do want people to actually get to the ending.
Hey everyone! This is my first time publishing a PICO-8 cart, I'm excited to get involved!
To get myself used to the PICO-8 a bit I thought I'd make a cart that simulates Bezier Curves! To put it simply, Bezier Curves are smooth curves, the plotting of which is influenced by a collection of control points. To put it longform... https://en.wikipedia.org/wiki/B%C3%A9zier_curve
- Use the arrow buttons to move the currently selected control point. (the selected one is highlighted white, while un-selected ones are grey). You will see the curve move as the points of influence move. (Note that it's not really a proper Bezier curve unless all the control points stay still while it is being drawn, I just found it fun to be able to move control points while the curve was being drawn)
- Press Z to select the next control point in the list. You can then move different points around the map to see how each one influences the curve.
- Hold X to activate options. While holding X:
-> tap up to add a new control point. This new control point will appear at a random point on the screen, and will be the new end point for the curve. It will become the selected control point. See how the curve changes based on each control point!
-> tap down to remove the currently selected control point. The starting control point will become the selected control point.
-> tap left to reduce the increment value. This means that from moving from the first point to the last point there will be more increments, resulting in a smoother curve. The way I programmed it I only draw one increment each frame, so this will make the drawing slower. If you keep reducing it the curve will stop, and if you go past there the curve will start moving backwards.
-> Tap right to increase the increment value. This means that there will be less increments when drawing from the first point to the last point, so the curve will be less smooth.
This cart is intended to demo what Bezier curves look like and how you can manipulate them, although I've tried to write it so it will be as easy as possible for anyone to take the bezier curve code out of it for their own purposes! If you want to use Bezier curves in your own code, grab the CALXY(CPS,T) function, the DFOR(I,C,CPS,CPNO,T) and the BINOMIAL(N,K) functions. You should make a variable that calculates how far along the curve you want to find the point for (which my example code calls T). Calculate T however you want, then call CALXY(CPS,T) passing in a 2DArray of coordinates for CPS (ControlPointS) and your T value for T. This function will return the X and Y values at that point. You could use this code to make a game object move along the curve, for example.
Let me know what you think, and if I'm missing any obvious Lua tricks let me know! I'm pretty new to the language.
Updated to display controls at the beginning, and stop big white lines being drawn while moving control points.