SolaEngine

By CCTech



(The Player demo)


pastebin run 7T0XNbYe

About
SolaEngine is a small game engine made for the ComputerCraft community to be able to create games a little bit easier
SolaEngine has 3 User-friendly APIS at the moment (There will be more in the future).

It is still in developement that means likely everything you'll see will be changed such as the UI and some functions.

SolaEngine uses a node system for an orderly game developing. SolaEngine uses the Computercraft edit and paint program until it get its internal Script- and Sprite Editors. So far SolaEngine just has the Game-Builder/Compiler and the Component Editor (The main program). It also includes some demo games inside the "Demos" folder

How to use
SolaEngine is a small easy-to-use game engine.

First you will need to install it and run "SolaEngine" inside the "SolaEngine" Folder.

Then this screen will pop up:

http://prntscr.com/myr5vg

Just enter the name of your project, If it already exists then it will be opened. If it doesn't exists then it will be created.
If it's a new game then this screen will appear:

http://prntscr.com/myr6fd

In the Top-Bar there are 4 Buttons: "Add" "Delete" "Build" "Quit" – They should be self-explaining :P/>
by clicking on "Add" There a small menu will pop up saying "Node" "Script" and "Sprite". The delete button will open up a dialog field which asks you for the filename you want to delete. Build will open a new Window which asks you for the main script file which will be started when launching your game.

The menu that pops up when you click on "Add" will give you buttons to choose which will create the said file. A node is working like a folder.

The white bar under the topbar is the "Navigation-bar". If you would like to go into a node then type the name of it. If you type in a script or sprite name. Then it will open the paint or edit program.

A Script in SolarEngine has to contain a loop simillar to following in the last lines:
[
-- Functions and Player/Collisions generating. Most Important is a draw function!

while true do  -- Can be another variable that returns true
  player.control(keys.w, keys.a, keys.s, keys.d, true, true, true, true)  -- WASD to move. The player is allowed to move to every direction
  draw()  -- Call the draw function. Can be called as you wish
  player.Movement()  -- Render the player
  -- Something else you wish
end


APIS:
player
player.spawn(SpritePath, x, y)   -- This will spawn the player using the Sprite from the Path at the x and y positions
player.control(up. left, down, right, AllowUp, AllowLeft, AllowDown, AllowRight)  -- This will handle the player control. you have to define the keys using (keys.(key)) to define the keys. And the "Allow..." parts are booleans
player.Movement()  -- This is just handling thr player rendering
player.setPos(x,y)  -- This will change the player's position
player.setHealth(points)  -.- This will set the Players health
player.heal(points)  -- This will heal the player
player.damage(points)  -- This will damage the player
player.kill()  -- This will kill the player
player.CurrentPlayer[]  -- using this table you can eit player variable. Aviable Variables: "Sprite", "XPos", "YPos", "Health"


collisions
collisions.new(StringName, x, y)  -- This will create a new collision at the given x and y coordinates. Also the name has to be a string
collisions.kill(StringName)  -- This will remove the collision you entered



game

game.exitKey  -- This variable defines the exit-key to leave the game. The key has to be defines as: keys.(key). Default is: q
game.exit()  -- This will exit the game
game.checkExit()  -- This will check if the exitKey has been preesed. This is not needed when there is a player in the current script.



There will be more APIS in the future.

To do:
  • Scene API, Multiplayer API + Support and more
  • Major UI fixes
  • Script Editor
  • Scene Editor (maybe)
Any feedbacks and suggestions are apperciated! :D/>