代码
var Ball = function(game) { var o = game.imageByName('ball') // var image = imageFromPath('ball.png') o.x = 100 o.y = 200 o.speedX = 5 o.speedY = 5 o.fired = false o.fire = function() { o.fired = true } o.move = function() { if (o.fired) { // log('move') if (o.x < 0 || o.x > 400) { o.speedX = -o.speedX } if (o.y < 0 || o.y > 300) { o.speedY = -o.speedY } // move o.x += o.speedX o.y += o.speedY } } o.反弹 = function() { o.speedY *= -1 } return o}复制代码
你好你好你好你好你好你好
列表
- a
- b
- c
链接 图片
字体
cheche cheche cheche
表格
dog | bird | cat |
---|---|---|
foo | foo | foo |
bar | bar | bar |
baz | baz | baz |