Skip to content

Navigation Menu

Sign up
Jonathan Chung edited this page May 7, 2013 · 6 revisions

Introduction

Stencyl's engine is written on top of NME, a popular Haxe library that replicates the Flash API. In order to understand the engine, it helps to know Haxe or ActionScript 3.

Stencyl is heavily reliant on Box2D, a popular physics library used in many games.

Prerequisites

Here's what you need to know to understand the Stencyl engine.

  • Haxe or ActionScript 3
  • Knowledge of Box2D is extremely helpful if working with physics
  • Basic knowledge of Flash API's fundamentals like the display tree, sprites, etc.

IDEs

Developing in Haxe is still somewhat behind other environments. Here are the best options which have Haxe integration built in (code completion, syntax highlighting).

  • Sublime Text 2
  • Flash Develop (Windows only)
  • Mono Develop
  • EclipseHX

Developing in a plain text editor is another fine choice.

Basics

Scenes

Scenes are the game's worlds. They consist of terrain (in the form of tiles), actors, backgrounds and some behaviors.

Actors

Actors are game objects. Every actor is associated with a Box2D body, a set of animations and some behaviors that bring it to life.

Behaviors

Behaviors are configurable, reusable components that add logic to Actors or Scenes.

Key Files (relative to Source/)

These are the files that you're most likely to edit or view.

[GLOBAL]

  • Universal.hx - Entry point for a game. Sets up the screen / scaling options.
  • com/stencyl/Engine.hx - Holds the "game loop" and is the center for pretty much everything.
  • com/stencyl/Data.hx - Controls initial loading of data.
  • com/stencyl/Input.hx - Controls all user input.

[BEHAVIORS]

  • com/stencyl/behavior/Script.hx - Holds the public API for all behaviors.
  • com/stencyl/graphics/G.hx - The custom drawing API.

[KEY MODELS]

  • com/stencyl/models/Actor.hx - The Actor class.
  • com/stencyl/models/SoundChannel.hx - Controls Sound playback. Relevant for those tackling sound problems/deficiencies.

Data Formats

TODO

Clone this wiki locally

AltStyle によって変換されたページ (->オリジナル) /