Creating Animated Apps: Canvas與ImageSprite 靜宜大學資管系 楊子青
2.3 ImageSprite的Heading與Speed屬性 indicates the direction in which the ImageSprite should move, in degrees. For example, 0 means due right, 90 means straight up, 180 means due left, and so on. Speed specifies how many pixels the ImageSprite should move whenever its Interval passes.
不同方向對應之Heading角度值 45 90 135 180 225 270 315
火箭發射子彈,子彈往上跑
2.4 偵測是否遇到邊界 使用EdgeReached(number edge)事件 Event handler called when the sprite reaches an edge of the screen. The edge argument tells which edge (or corner) was reached, encoded as follows: north = 1 northeast = 2 east = 3 southeast = 4 south = -1 southwest = -2 west = -3 northwest = -4
子彈沒打到,到達邊界則消失
2.5 碰撞(Collided With) Shooting games, sports, and other animated apps often rely on activity occurring when two or more objects collide.
子彈打到(碰撞),分數加1