Skip to content
A WIP library for using SmileBASIC-like features in Love2D!
Lua GLSL
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.screenshotsForREADME
SmileBASIC
docs
game
maps
resources
.gitignore
README.MD
game.lua
main.lua
watch.lua

README.MD

Pretty Icon Love2D SmileBASIC Library

Want to port your games and applications over to Love2D? This library makes it easy to add Text layers, Sprites, Backgrounds, and Animations, while maintaining the SmileBASIC aesthetic!

WARNING: Due to copyright concerns, the default SmileBASIC Sprites and Backgrounds are not distributed with this library. Replace both resources/sprites.png and resources/tiles.png with their actual versions before using this library. You can also just use a different spritesheet and tilesheet, but that sorta misses the point of this entire library... (The text is distributed with this because why not)

A bunch of fish orbiting a map. There are two lines text in the top left corner that both read "Hello, world!". One is green.A grid of random sprites. Multiple fish are still orbiting a map. The map is translucent. The text is also still there, and it still reads "Hello, world!". A very large sprite reading SmileBASIC (C) SmileBoom. The sprite is at an extreme angle.Multiple lines of multicolor text fill the background. In the foreground is a small box of text. It is also at an extreme angle.

(Please note that I am not SmileBoom or associated with SmileBoom.)

Usability status!

Pretty gosh darn useable! The animation syntax is likely to change, but you can also use it the way I'm using it in game/animTest.lua

Layout

This repo is split into a bunch of separate folders and files.

  • docs/: Contains the documentation. You can read it online here!
  • game/: You don't have to worry about anything here. You can easily throw it away. This does have two three test programs that test Sprites, Backgrounds, Text, Basic Z-sorting, Animations, and... shaders? for some reason?
    • animTest.lua: A demonstration of animations!
    • apiTest.lua: WHOOAAAAAAA fish (Demonstrates loading a map from a file, Sprite callbacks, Sprite definitions, blend modes, Background callbacks, Text colors, and transparency)
    • textTest.lua: Random text colors and printing! Also shaders for some reason! This also demonstrates a "cut out" effect for text with a foreground color of 0 (transparent).
    • funky.frag: I split the shader into another file.
    • hsvtest.png and othertest.png: Both of these are used with the shader I'm messing around with.
  • maps/: For now, it contains one example map (map1.v360map) that you can use. It's in my horrible file format, too!
  • resources/: Some things in this are important, some things in this aren't.
    • characters.csv: Very important. Stolen from otyaSmileBASIC Generously donated by 12Me21. Used for the text layer's font.
    • sprites.csv: Relatively important. If you leave these out, that's completely fine. Used for Sprite definitions.
    • font_8x8.png and font_16x8.png: Not important. If you want some debug fonts, here you go. The 8x8 one is the regular SmileBASIC font. The 16x8 one is made by me.
    • icon.png: Not important. Fish.
    • sprites.png: Very important. REPLACE THIS WITH THE ACTUAL VERSION BEFORE USING. Used in SmileBASIC/sprites.lua.
    • text.png: Very important. Used in SmileBASIC/text.lua.
    • tiles.png: Very important. REPLACE THIS WITH THE ACTUAL VERSION BEFORE USING. Used in SmileBASIC/backgrounds.lua. Inconsistent naming, but okay.
  • SmileBASIC/: Contains all the modules. Or whatever they're called.
    • animations.lua: Unfinished. For animating Sprites and Backgrounds.
    • backgrounds.lua: Finished. For creating tile backgrounds.
    • smilebasic.lua: Finished? Abstract thing that Backgrounds, Sprites, and Text all inherit from.
    • sprites.lua: Finished? For creating movable, rotatable, stretchable, animatable, dyeable pieces of a spritesheet.
    • text.lua: Finished. For creating text screens and printing text to them.
    • zsorting.lua: Finished? For sorting all things that inherit from smilebasic.lua, and drawing them in order.
  • game.lua: main.lua runs this after setting up a bunch of things. I styled it after PICO-8's game loop thing. For now, it's just a game selector. If you want to modify this: use setup(), update(), and draw().
  • main.lua: This is the template I usually start with when making things in Love2D.
  • watch.lua: This is a small library that keeps track of when a condition is met, how long it has happened for, and when it stops being true. Useful for buttons and other inputs.
  • profile.lua: This won't show up in the actual repo, but it's a lightweight profiler for Love2D. Disabled by default and not included, so you have to download it from here.
  • README.MD: You're already there.

To-do

  • Completely separate the main.lua and everything else. main.lua is my Love2D template, and I don't want that to get in the way of anyone wanting to use this.
  • The new icon I drew has both the red and blue parts split 50/50. This is not the case in the actual Love2D logo. Too lazy to fix
  • Add attributes to text

Issues? Improvements?

Tell me! I really want to help people port their SmileBASIC programs to other languages so SmileBASIC can live on. Feel free to create an Issue or do a Pull Request! I don't quite know how Git works!

License

Just don't steal it and pass it off as your own thing, okay?

Credits

  • V360 - All of the code, Sprite definition listings
  • SmileBoom - Most assets, also for making SmileBASIC
  • otya - Working on a similar thing that deserves a lot of credit
  • 12Me21 - Better character listings
You can’t perform that action at this time.