Code Monkey home page Code Monkey logo

jscf's People

Contributors

g--o avatar gitter-badger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

gitter-badger

jscf's Issues

Re-organize update() vs tick_update()

Physics engine, Rigidbody, Scene and Game aren't synced on tick_update vs. update methodology.
Delta time should be configurable at runtime and callbacks should have update vs tick_update.

Should be as follows:

  • Update is roughly with periodic input/output (say music, rendering, keyboard updates, etc..)
  • Tick Update is the logic update, roughly with the different managers (physics, gui, etc..), components, entities etc. It is called after their logic is done.
  • Pre-Tick Update: Optional but can be really effective - a user tick that occures before the engine's tick.

These should allow customizability again, as manual update/render should be non-relevant as JSCF becomes an engine rather than just a library, as well as it's editor, which perhaps might be usable for meta-editing.

Missing Documentation: API page.

Documentation is lacking to say the least. We need to move from looking at source code to a page or two of API and explainations.

Container Component: auto fit to entity dimentions

Making an auto fit for entity's dimentions via container component.
Simply set dimentions of fixed name background graphic renderer of the default container to the dimentions of the entity (automatically returns the largest/encapsulating dimentions).

Relevant source: gui.js

Editor: Meta-program code editor

Adding an existing web code editor to be combined with the editor (essentially meta-program).
Will allow to edit the game scripts and save them to disk. Will update engine as well.

Right now considering:

  • ace-editor (tern plugin?)
  • codeMirror
  • Codiad

Note: Should work client-side only, AND work offline (beware of chrome cross origin stuff).

UI: Layout management

We need to consider wether or not to use existing code for layout management and either way - getting it up and running already because as of now all elements are centered and any repositioning is done manually.

Relevant files: gui.js mostly.

Gui + CanvasInput: textbox disable on removal

Right now even after deleting the owning entity, a textbox will still be invisibly active. This has to do with cleaning up after using CanvasInput textbox.

Probably we need to call Textbox.Destroy() in an elegant way.

Namings and conceptions

Rename Entity -> GameObject
Rename PhysicsEngine -> JSCFPhysics and allow physics engine selection

Considering inheritance: Components, Sprites, Point2d+Vector

Basically using a paradigm of inheritance via:

function child_ctor(...) {
    parent_constructor.call(this, ...);

    // actual initiator
    this.init = function() { ... };

    //...

    this.init();
}

The problems considering this option are:

  • Breaks the getComponent related methods somehow
  • Different sprites want to override update/render while retaining parent's update/render as seperate method.
  • For point2d: inherits methods that don't really apply to points as a concept like dot product

World Editor: assets visual controls

Visual controls of assets.

  • Drag n drop / move tool to move entities and sprites.
  • Resize tool for entities and sprites.
  • Rotate tool for entities and sprites.

World Editor: Inspection Panel

We want an inspection panel that will be updated with selected entity/component/object.
This is a huge step to making the engine more comfortable.
We can use the rectangle editor component for selection. (might want to add treeview later)

For now, we need help planning this out, and later on we'll make an implementation issue.

Performance: Spacial Trees (e.g: Quad Tree)

To improve performance we need to use better scene management techniques like spacial trees.
A simple suggestion would be having a QuadTree to speed things up.
Implementing it without breaking other modules would be a great achievement.

Relevant files: scene.js, sceneManager.js and maybe entity.js.
Good luck!

Code conventions

Seems like code conventions aren't as strict as they should
Differentiate member naming vs. function naming to solve the issue

Transform: change to core entity component

Right now it's a property, but we'll want it to be a component.
This will create dependency between components but entity should be free of properties that aren't part of it's definition.

createEntity() will not add transform.
createGameObject() will.

Notes on the decision:

While a lot of engines might force you to keep the transform component, I suggest entity to be an abstract thing, that can exist without any definite location.

Since the core principal of the engine to begin with was extendibility - custom types and scripts can be made only if the entity is abstract as to allow to override update & render, but still provides hirarchy.

When the javascript inheritence concesus will arrive (issue #8 ) we might have actual Game Object that inherits from the abstract entity.

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.