| 1 |
import net.endflow.util.KeyIf; |
|---|
| 2 |
import net.endflow.util.Delay; |
|---|
| 3 |
|
|---|
| 4 |
var ship:Ship = new Ship(_root); |
|---|
| 5 |
Key.addListener(this); |
|---|
| 6 |
this.onKeyDown = KeyIf.f({ |
|---|
| 7 |
UP: function(){ship.up()}, |
|---|
| 8 |
DOWN: function(){ship.down()}, |
|---|
| 9 |
LEFT: function(){ship.left()}, |
|---|
| 10 |
RIGHT: function(){ship.right()}, |
|---|
| 11 |
SPACE: {CONTROL: {_90: function(){ship.shot()}}}, |
|---|
| 12 |
PGUP: [function(){ship.up()}, function(){ship.shot()}], |
|---|
| 13 |
PGDN: [function(){ship.down()}, function(){ship.shot()}], |
|---|
| 14 |
HOME: {_82: function(){ship.reset()}}, |
|---|
| 15 |
_88: function(){ |
|---|
| 16 |
ship.shot(); |
|---|
| 17 |
Delay.f(function(){ |
|---|
| 18 |
ship.shot(); |
|---|
| 19 |
Delay.f(function(){ |
|---|
| 20 |
ship.shot(); |
|---|
| 21 |
}, 200); |
|---|
| 22 |
}, 200); |
|---|
| 23 |
} |
|---|
| 24 |
}); |
|---|