-
Notifications
You must be signed in to change notification settings - Fork 277
/
Copy pathanim3.js
62 lines (41 loc) · 1.54 KB
/
anim3.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
goog.provide('test.anim3');
goog.require('lime');
goog.require('lime.CoverNode');
goog.require('lime.Director');
goog.require('lime.Layer');
goog.require('lime.Scene');
goog.require('lime.Sprite');
goog.require('lime.animation.Delay');
goog.require('lime.animation.MoveBy');
goog.require('lime.animation.MoveTo');
goog.require('lime.animation.RotateBy');
goog.require('lime.animation.ScaleBy');
goog.require('lime.animation.ScaleTo');
goog.require('lime.animation.Sequence');
test.WIDTH = 800;
test.HEIGHT = 400;
test.start = function() {
//director
test.director = new lime.Director(document.body, test.WIDTH, test.HEIGHT);
test.director.makeMobileWebAppCapable();
var gamescene = new lime.Scene;
var flameLayer = new lime.Layer();//.setRenderer(lime.Renderer.CANVAS); flameLayer.setPosition(100,0);
gamescene.appendChild(flameLayer);
var scale = 1;
var flame = new lime.Sprite;
flameLayer.appendChild(flame);
flame.setFill(100, 0, 0).setPosition(0, 100).setSize(100, 100);
var move = new lime.animation.MoveBy(700, 0).setDuration(5)
.setEasing(lime.animation.Easing.EASEINOUT);
move.addTarget(flame);
move.play();
flame = new lime.Sprite;
flameLayer.appendChild(flame);
flame.setFill(100, 0, 0).setPosition(0, 210).setSize(100, 100);
move = new lime.animation.MoveBy(700, 0).setDuration(5).setEasing(lime.animation.Easing.EASEINOUT);
move.addTarget(flame);
move.play();
// set active scene
test.director.replaceScene(gamescene);
};
goog.exportSymbol('test.start', test.start);