Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Godsoul - Insane Dungeon Crawler.


JohnPony
 Share

Recommended Posts

To further exemplify the potential of the scripting system, I have created a NPC from a script file that appears in game (the green eye-like thing):

![](http://i.imgur.com/N46JsBI.png)

And the script code:

```
/* Copyright (C) KAO Interactive, Inc - All Rights Reserved
* Unauthorized copying of this file, via any medium is strictly prohibited
* Proprietary and confidential
* Written by John Lamontagne , Feburary 2014
*/

using Dungeon_Crawler_Utilities;
using Dungeon_Scripting_Interface;
using Dungeon_EventDispatcher;

namespace Dungeon_Crawler_Client.World.Entities.Npcs
{
// This script will add a strange eye monster to our dungeons.
public class StrangeEyeScript : IScript
{
public StrangeEyeScript()
{
// Empty constructor; we don't need to put anything here at the moment.
}

// This property lets the script manager know exactly what event this script is going to be binded to.
// Im our case, it's the playerMoved event.
public string EventName
{
get { return "dungeonGenerated"; }
}

// This is the entry point for our script.
// This is called whenever the event that our script is binded to is raised.
// An object which implements IEventDispatcherArgs is passed in as an argument.
// This particular script should know exactly what this object provides.
public void Execute(IEventDispatcherArgs eventArgs)
{
dynamic dungeonEventArgs = (dynamic)eventArgs;

dungeonEventArgs.Dungeon.SpawnNpc(new StrangeEye(), new IntVector(10, 10));

}

}

public class StrangeEye : INpc
{
public string TextureName { get; set; }

public Transform Transform { get; set; }

public string Name { get; set; }

public float Speed { get; set; }

public int Level { get; set; }

public StrangeEye()
{
this.Name = "Strange Eye";
this.TextureName = "charNewteye";
this.Level = 5;
this.Speed = .2f;
}
}
}

```
Link to comment
Share on other sites

  • Replies 58
  • Created
  • Last Reply

Top Posters In This Topic

Alpha testing will begin in a few weeks.

Sign up early to get your free key! All alpha testers will receive free content points when the game is released!

Please sign up for alpha testing here:

[http://www.godsoul.kaointeractive.com/forumdisplay.php?fid=4](http://www.godsoul.kaointeractive.com/forumdisplay.php?fid=4)
Link to comment
Share on other sites

  • 2 weeks later...
Decoupled the SceneManager/GameScene/MenuScene from the SFML rendering implementation details.

Also added the ability to control dialogue text speed in the dialogue files.

For example:

```
[Character Transition Time: 50]
[Part 1]
Example dialogue...
[Part 2]
;)
[End]

```
As I said before, the project is now open source, which allows for collaboration. Anyone can contribute; this can be through the means of assets (art, music, sfx, etc.), or code.
Link to comment
Share on other sites

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
 Share


×
×
  • Create New...