HTML5 游戏引擎 Coffee2D

码农软件 · 软件分类 · 游戏开发包 · 2019-10-05 08:58:14

软件介绍

Coffee2D 是一个 HTML5 游戏引擎,它将开发 HTML5 Canvas 游戏中大量的工作抽象出来,例如 CoffeeScript 特性(如 class 关键字)来更好的与游戏和 CoffeeScript 集成。

Coffee2D 当前提供:

  • 简单场景图

  • 精灵渲染

  • 事件处理

  • 动画

  • Isometric 地图

组件:

class Card extends Component
  constructor: (@suit, @value) ->
    super()
    @setSize(50, 80)
    # the rectangle will be drawn automatically
    @addChild new Rect 0, 0, @size.w, @size.h, 'white'

  update: (dt) ->
    # dt is delta time passed since last update
    # (update stuff...)
    super()

  draw: (ctx) ->
    # ctx is the canvas context associated with this scene
    # (draw additional stuff other than the rectangle...)
    super()

事件处理:

# event origin is automatically set to unit
unit.dispatchEvent {type: 'kill', target: enemy}
enemy.addListener 'kill', (evt) -> if evt.target == enemy then enemy.die()

# can also fire events from Event class, origin will not be set
Event.dispatchEvent {type: 'init'}

本文地址:https://codercto.com/soft/d/16072.html

Code

Code

Charles Petzold / Microsoft Press / 2000-10-21 / USD 29.99

Paperback Edition What do flashlights, the British invasion, black cats, and seesaws have to do with computers? In CODE, they show us the ingenious ways we manipulate language and invent new means of ......一起来看看 《Code》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

MD5 加密
MD5 加密

MD5 加密工具

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具