Kamatsu's Class Library
From Spheriki
Kamatsu's Class Library is an extensible object library made in sphere based on Kamatsu's Spheritype Engine. The KCL is designed to provide all the basic functionality required to create a small console-style RPG from beginning to end. Alot of it's structures are modelled on the equivalent structures from the RMXP engine, however the Class Library is more extensible and faster. The Class Library is likely to be the system that will be used as the scripting backbone of the Sphere Community Game, Esphera.
kclSpheritype.js: The Spheritype Engine
The Spheritype Engine is an advanced, powerful script that allows for advanced Object oriented programming within Sphere's JavaScript. The article on Object oriented programming explains how to use it. In short, it allows for the following things to be achieved in JavaScript that were formerly impossible or difficult:
- Clean Syntax for Object Definitions and Prototyping
- Inheritance done within object definition, not within constructor or outside of the object.
- Inheritance from multiple superclasses.
- Advanced Polymorphism
- Access of the superclass, to allow one to simply "extend" on an existing method in a superclass rather than totally override it.
- Static data within objects
- Object prototypes that instantiate themselves (single-instance objects).
kclDeclares.js: Global Declarations
This file includes global declarations used in the KCL. This includes:
- Constants such as
ALIGNMENT_TOPLEFT,WINDOWSTYLE_NONEand others. - The Game object, defining default resources to use throughout the KCL.
kclWrapperClasses.js - Obsolete Object Wrappers
This file includes Spheritype-defined classes that wrap around sphere objects (Image, Surface, Spriteset etc.). This file is obsolete in the upcoming Sphere version and will soon be removed from the library.
kclPrototypeExtensions.js - Extensions to JS Prototypes
This file includes all extensions to existing JS data prototypes (such as String, Number, etc.). In older versions, this file includes Tunginobi's wrapping functions, which are no longer needed in the upcoming Sphere version, and will be removed.
kclWindowClasses.js - Windowing Classes
- See Main Article: KCL: Windowing Classes for thorough documentation and examples
This file includes all windowing classes used by the KCL. In other words, it includes the Window class and all of its children, except those that are in the MenuClasses.js file, i.e:
- Window
- ImageWindow (inherits from Window)
- TextWindow (inherits from Window)
- MessageWindow (inherits from TextWindow, includes sub-objects of type TextWindow and ImageWindow)
kclScreenElements.js - Screen Elements
- See Main Article: KCL: Screen Elements for thorough documentation and examples
This file includes all the classes (i.e TextElement and ImageElement) that make up the KCL screen element system. These screen elements represent either an image, surface or text, and are useful in games that do not use the map editor or in animations, particularly seeing as these elements support movement according to polar coordinates through a go() function.
kclMenuClasses.js - Menu System
Not Yet Implemented (currently being worked on)


