Roblox's first fantasy console with 2D graphics!

Hello everyone! I’m Weldify, and it’s just about time to introduce you to one of my latest creations - Weng128! Weng128 is a fantasy console vastly inspired by Pico-8.

It features 2D graphics, input (keyboard/mouse) and sound!
It’s very simple and is probably one of the best ways to see progress with your own eyes, that being said, this is probably one of the best lua sandboxes for absolute beginners.

To run or rerun your game, click on the frame on the right of your screen and press TAB.
(When launching the game, there will be a code example. Use the arrow keys to move your character)

Game link:
https://www.roblox.com/games/3558040921/Weng128

Cheatsheet:

--<< CONSTANTS / ENUMS >>--

float PI = 3.14159...

int COLOR_BLACK
int COLOR_WHITE
int COLOR_DARKGRAY
int COLOR_RED 
int COLOR_GREEN  
int COLOR_BLUE 
int COLOR_ORANGE 
int COLOR_YELLOW 
int COLOR_BROWN  
int COLOR_PURPLE 

int KEY_UP
int KEY_DOWN
int KEY_LEFT
int KEY_RIGHT
int KEY_W
int KEY_A
int KEY_S
int KEY_D
int KEY_SPACE

int MOUSE_LEFT
int MOUSE_MIDDLE
int MOUSE_RIGHT

--<< FUNCTIONS >>--

float Tick() // Returns the elapsed time since game startup.
float Wait(float seconds?) // Stops code execution for as long as you desire. If seconds is not defined, it will wait for approximately 0.03 seconds.

void Print(any ...) // Outputs strings, numbers, etc... to the console on the right of your screen.

float Sin(float number) // Sine of a number
float Cos(float number) // Cosine of a number
float Max(float ...) // Returns the biggest value from the passed values
float Min(float ...) // Returns the smallest value from the passed values

void Present() // Updates the screen, thus displaying all the drawn objects.
void Clear(int color?) // Fills the entire screen with the specified color, if you didn't pass one then it'll just fill it with pitch-black.

void Push() // Saves the current graphics state, this includes all Settable variables listed below.
void Pop() // Restores the previously saves graphics state. Sets all the Settable variables to what they were when calling Push().

void SetColor(int color) // Sets the color for all future draw operations.
void SetPivot(float x, float y) // Sets the point of rotation for all future draw operations performed on polygons.
void SetAnchor(float x, float y) // Sets the center position for all future draw operations performed on sprites and polygons.
void SetAngle(float angle) // Sets the rotation angle for all future draw operations performed on polygons. angle is in radians.

int, int GetMousePos() // Gets the current mouse position on the screens pixels.

bool KeyDown(int key) // Checks whether the passed key is currently held down.
bool KeyPressed(int key) // Checks whether the passed key was pressed since the last call of KeyPressed().
bool keyReleased(int key) // Checks whether the passed key was released since the last call of KeyReleased().

bool ButtonDown(int button) // Checks whether the passed mouse button is currently held down.
bool ButtonPressed(int button) // Checks whether the passed mouse button was pressed since the last call of KeyPressed().
bool ButtonReleased(int button) // Checks whether the passed mouse button was released since the last call of KeyReleased().

Sprite LoadSprite(array data) // Constructs a Sprite object from the passed array and returns it.
Music LoadMusic(int id, float volume?) // Constructs a Music object from the passed id (SoundID) and, optionally, volume.
                                       // Volume defaults to 1. 

void PlayMusic(Music music) // Plays a Music object
void StopMusic(Music music) // Stops playing a Music object
void SetMusicVolume(Music music, float volume) // Adjusts volume for a Music object
void Sound(int id, float volume?) // Plays a sound once. Volume defaults to 1.

void Pixel(int x, int y) // Draws a single pixel at x, y
void Line(float x1, float y1, float x2, float y2) // Draws a line between x1, y1 and x2, y1
void Circle(float x, float y, float radius, int segments?) // Draws a circle at x, y with the specified radius. 
                                                           // segments determines the amount of lines used to draw the circle, 
                                                           //and is optional. 

void Sprite(Sprite sprite, float x, float y, float scale?) // Draws a Sprite object at x, y with the option to specify its scale.
void Polygon(float x, float y, float ...) // Draws a polygon at x, y. ... must consist out of x, y float pairs that specify
                                          // the polygons points. The points are relative to x, y.
                                          // The last point automatically joins with the first point.

ENJOY!!!

8 Likes

amazing man, i love it! Just cool.

1 Like

Thanks! It’s good to see someone actually tried it out. If theres anything you want to know or have any suggestions, make sure to drop them here!

1 Like