GithubHelp home page GithubHelp logo

makai / gameconsole Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tiagolr/dconsole

0.0 1.0 0.0 1.24 MB

Haxe game-like console that provides runtime acess to methods, variables and more.

License: MIT License

gameconsole's Introduction

Game Console

Game Console is a real-time console that allows you to:

  • View or edit variables.
  • Call methods.
  • Log messages.
  • Monitor variables.
  • Monitor methods.
  • Customize appearence with themes.
  • Profile your app
  • Add your own commands by extending this lib.
  • Use basic autocomplete

V 3.0.0

  • API changes - GameConsole renamed to GC, registerFunction changed, registerFieldRemoved etc..
  • Monitor improved and refactored.
  • Print command added.
  • Profiler added
  • Added unit tests to ensure core working with neko, cpp and flash targets.

For more changes or other versions, check CHANGELOG file.


Example

Using GameConsole is very straightforward:

    import pgr.gconsole.GC;

    GC.init();
    GC.log("This text will be logged.");
    GC.registerFunction(this.testFunction, "functionAlias");
	GC.registerObject(this, "objectAlias");

Now while running your game or app, press TAB, then type "help" or "commands" to see what commands or keys are availible.

For more help and check the Wiki (may not be up-to-date) and/or see the comments in GC.hx.

Screenshots

A screen shot of gconsole running on Adam's Atomic Mode game.

ss

comming soon

Monitor

Allows to follow the values of registered fields, (including private fields and with getter methods)

For example, to monitor player x position:

CG.monitorField(player, "x", "playerX")  

Thats it! Press CTRL + TAB to bring the monitor up inside the game
monitor

Profiler

GCProfiler is lightweight and portable, it allows to know in runtime:

  • What code is taking more cpu
  • How many times is some code executed inside other code block.
  • How much time code takes to execute (benchmark)
  • Other statistics not displayed (absolute elapsed, min, max, totalInstances etc..)

To profile a block simply do:

GC.beginProfile("SampleName");
GC.endProfile("SampleName");

To toggle the profiler use SHIFT + TAB.
The screenshot below shows multiple nested samples, idents are used to show the samples hierarchy.

profiler

  • EL elapsed milliseconds)
  • AVG average elapsed milliseconds)
  • EL(%) elapsed percentage
  • AVG(%) average elapsed percentage
  • # Occurrences of sample inside root sample
  • Name Sample name

More documentation and examples comming soon.

Suggestions / Comments / Bugs

Email me any suggestions, comments, bug reports etc.. you have.
Or create a new issue (even better).

Contributions

Make sure tests work with your changes by running tests/testFlash.bat, testNeko.bat, testWindows.bat Update tests or write new ones if necessary, the objective is to garantee the console works in all targets as its supposed to.

Contributors

Thanks to:

  • Artem Pecheny
  • Jesse Talavera
  • Samuel Batista
  • Alexander Hohlov

And others submiting issues/feedback so far.

gameconsole's People

Contributors

tiagolr avatar pecheny avatar jessetg avatar beeblerox avatar gamedevsam avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.