Jump to content
  • entries
    22
  • comments
    11
  • views
    25678

Toasty Update #9

Sign in to follow this  
nhold

1185 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:

AngelScript1.PNG
AngelScript2.PNG

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.
Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!