
Super Octothorpe
A downloadable game for Windows
Getting Started
Specs
Super Octothorpe has a 240 x 135 pixel screen. It has a single controller with the following buttons:
A, B, X, Y, D-Pad Down, D-Pad Right, D-Pad Left, D-Pad Up, Start, Select, L, and R
Cartridges
Cartridges are single C# files that can have the extension .cs
or .cart
.
Placing these files in /Content/Cartridges
will cause them to appear in the UI.
You do not need to compile these files. The Super Octothorpe will compile them for you during boot. These files are compiled in release mode with full optimization.
In order to boot, your code must have a static method with the following signature:
public static void Update(IConsole console)
in a class named Cartridge
. You may use any namespace, but Game
is common.
This method will be called once per frame. Your code should complete within 12 milliseconds to maintain 60 frames per second (accounting for overhead).
Sandboxing
C# is a powerful language. Although Super Octothorpe cartridges use C#, it will not compile everything written in C#. The micro console will not compile anything it considers potentially harmful. Examples include file system access, networking, system information, multithreading, reflection, and much more.
Super Octothorpe provides no security guarantees, but this sandboxing should be sufficient for sharing cartridges.
Multitasking will be provided through IConsole
in the future.
Workflow
- Open Super Octothorpe
- Open your cartridge
- Edit the C# file in a text editor
- Save the C# file
- Press L + R + Select to reload the cartridge, including your changes
Errors
Compilation and runtime errors are logged to Files/Logs/<CartridgeName>.txt
.
Debugging
Debugging is not currently supported, but should be in the future.
API
In addition to most primitive types, collections, and commonly used types, the following C# types and their associated functions are available:
IConsole
namespace Protosprite.Games.MicroConsole
IConsole
controls your access to Super Octothorpe, including writing to the screen, reading from the screen, reading from the controller, getting the elapsed time since the last frame, frame counts, saving and loading, and playing sound (not currently available).
PaletteColor GetPixel(int x, int y)
Gets a PaletteColor
from the specified x
and y
coordinate on the screen.
void SetPixel(int x, int y, PaletteColor color)
Sets a PaletteColor
to the specified x
and y
coordinate on the screen.
ControllerButtons GetControllerButtons()
Gets the buttons currently pressed on the controller.
float GetElapsed()
Gets the time elapsed since the last frame, in seconds.
int GetFrameNumber()
Gets the frame number. The Super Octothorpe has a fixed update rate of 60 frames per second, not accounting for slowdown.
void SaveData(string data)
Saves data. The data can be loaded on future boots.
string LoadData()
Loads data that was previously saved.
ControllerButtons
namespace Protosprite.Games.MicroConsole
{
using System;
[Flags]
public enum ControllerButtons
{
None = <span class="hljs-number">0</span>,
A = <span class="hljs-number">1</span>,
B = <span class="hljs-number">2</span>,
X = <span class="hljs-number">4</span>,
Y = <span class="hljs-number">8</span>,
DPadDown = <span class="hljs-number">16</span>,
DPadRight = <span class="hljs-number">32</span>,
DPadLeft = <span class="hljs-number">64</span>,
DPadUp = <span class="hljs-number">128</span>,
Start = <span class="hljs-number">256</span>,
Select = <span class="hljs-number">512</span>,
L = <span class="hljs-number">1024</span>,
R = <span class="hljs-number">2048</span>,
Any = <span class="hljs-number">4095</span>
}
}
Checking if a button is pressed:
if ((buttons & ControllerButtons.DPadLeft) == ControllerButtons.DPadLeft)
{
...
}
Status | In development |
Platforms | Windows |
Author | Protosprite |
Download
Click download now to get access to the following files:
Leave a comment
Log in with itch.io to leave a comment.