HTML5 游戏引擎:CanvasEngine

jopen 11年前

Canvas Engine 是个 HTML5 Canvas 框架,也是个面向 2D 的视频游戏。Canvas Engine 能提供所有 HTML5 创建简单游戏的 Canvas,提供给游戏架构一个简单的 API。用 Canvas Engine 制作的游戏能兼容所有主流的浏览器,支持触屏设备和移动设备。

特性

Low-level API

  • Fullscreen support (Supported platforms).
  • Multiple image file formats: DDS, JPG, PNG and TGA.
    • Define a transparent color
  • Scene Structure
    • Overlay scenes
    • Pause scene
  • Multiplayer model
  • Preloading
    • Get the percentage of loading
  • Elements Manipulation
    • Manipulation : jQuery syntaxe
    • Draw : HTML5 Canvas API syntaxe
  • Utilities
    • merge object
    • class

Windows

  • Dialog box with the outline
  • Cursor

Animations

  • Set an animation from a spritesheet
  • Frequence and animation speed
  • Sequence of multiple image
  • Creating a custom animation with multiple sequences
  • Display once, loop or temporary

Timeline (aka Tween)

  • Easy to make interpolations effects
  • 29 Effects :
    • easeInQuad, easeOutQuad, easeInCubic, easeOutCubic, etc.
  • Loop

Collision

  • Entities model
  • Test collision with virtual grid
  • Polygon intersection and Contains Point.

Text

  • Set maximum line width
  • Display effect
    • Line by line
    • Character by character
  • font file formats : TTF, EOT
  • external fonts
    • Google Fonts
    • Fontdeck
    • Fonts.com
    • Typekit

Sound

  • Multiple sound file formats: OGG, WAV, MP3.
  • Fading effects
  • Web Audio or SoundManager2

Effects

  • Change tone screen
  • Perform a flash
  • Shake screen

Scrolling

Level Design

Save & Load

  • Encoding with BISON.js

Spritesheet Management

Input

  • Access to input types: Keyboard, Mouse, Xbox360 Pad, Joysticks
  • click, dbclick, mousemove, mouseup, mousedown, mouseout, mouseover*
  • Multi-Touch with Hammer.js :
    • hold
    • tap
    • doubletap
    • drag, dragstart, dragend, dragup, dragdown, dragleft, dragright
    • swipe, swipeup, swipedown, swipeleft, swiperight
    • transform, transformstart, transformend
    • rotate
    • pinch, pinchin, pinchout
    • touch (gesture detection starts)
    • release (gesture detection ends)

项目主页:http://www.open-open.com/lib/view/home/1396964379325