• entries
22
11
• views
25287

# Toasty Update #9

1090 views

Hey guys!

The lack of recent updates was because I was travelling with my partner, we went to many places but the main event was Las Vegas new years, which was insane!

So, I've been back for a few days and I'm ready for another update in this one I have added a basic AngelScriptSystem, which is pretty interesting.

The angelscript system has a few cool features, the first being you can provide a main file to use which will make AngelScript your main entry point, this means your entire game needs to be in AngelScript rather than C++. The second is that you can add behaviour scripts to an entity, this should work exactly like Unity.

At the moment only the first feature is in place and I am still attempting to register all the methods and functions! But check it out:void main(){ print("Hello world\n"); print(1+1); print("Creating an entity!\n"); Entity@ ent = Entity(); print("The default name of this entity is: "); print(ent.GetName()); print("\n"); print("Setting the name to something else...\n"); ent.SetName("NathansEntity"); print("New name is: " + ent.GetName() + ".\n"); GameSystem testSystem; testSystem.AddEntity(ent); print("Starting the loop in...\n"); DoCountdown(5); while(true) { testSystem.Tick(); print(testSystem.GetFPS()); }}void DoCountdown(int a){ for( int n = 0; n < a; n++ ) { print(a-n+"\n"); WaitForSeconds(1); } print("Go!\n");}
The C++ is literally just this:#include "AngelScriptSystem.h"//Commented like a newb.int main(int argc, const char* argv[]){ Toasty::AngelScriptSystem* system = new Toasty::AngelScriptSystem(nullptr, "main.as"); delete system; return 0;}
This script results in the following:

The only issue is the fact that Toasty is modular which means I have to make a choice, does the angelscript system know about every other system or does every other system know about angelscript? Not sure at the moment, but as I think on it more I am sure I'll come to a conclusion.

There are no comments to display.