mausverfolger.php
Quell Code
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="authoring-tool" content="Adobe_Animate_CC">
<title>snake</title>
<!-- write your code here -->
<style>
body {background-color: #000; margin: 0px; }
#animation_container, #_preload_div_ {
position:absolute;
margin:auto;
left:0;right:0;
top:0;bottom:0;
}
</style>
<script src="https://code.createjs.com/createjs-2015.11.26.min.js"></script>
<script>
(function (cjs, an) {
var p; // shortcut to reference prototypes
var lib={};var ss={};var img={};
lib.webFontTxtInst = {};
var loadedTypekitCount = 0;
var loadedGoogleCount = 0;
var gFontsUpdateCacheList = [];
var tFontsUpdateCacheList = [];
lib.ssMetadata = [];
lib.updateListCache = function (cacheList) {
for(var i = 0; i < cacheList.length; i++) {
if(cacheList[i].cacheCanvas)
cacheList[i].updateCache();
}
};
lib.addElementsToCache = function (textInst, cacheList) {
var cur = textInst;
while(cur != null && cur != exportRoot) {
if(cacheList.indexOf(cur) != -1)
break;
cur = cur.parent;
}
if(cur != exportRoot) {
var cur2 = textInst;
var index = cacheList.indexOf(cur);
while(cur2 != null && cur2 != cur) {
cacheList.splice(index, 0, cur2);
cur2 = cur2.parent;
index++;
}
}
else {
cur = textInst;
while(cur != null && cur != exportRoot) {
cacheList.push(cur);
cur = cur.parent;
}
}
};
lib.gfontAvailable = function(family, totalGoogleCount) {
lib.properties.webfonts[family] = true;
var txtInst = lib.webFontTxtInst && lib.webFontTxtInst[family] || [];
for(var f = 0; f < txtInst.length; ++f)
lib.addElementsToCache(txtInst[f], gFontsUpdateCacheList);
loadedGoogleCount++;
if(loadedGoogleCount == totalGoogleCount) {
lib.updateListCache(gFontsUpdateCacheList);
}
};
lib.tfontAvailable = function(family, totalTypekitCount) {
lib.properties.webfonts[family] = true;
var txtInst = lib.webFontTxtInst && lib.webFontTxtInst[family] || [];
for(var f = 0; f < txtInst.length; ++f)
lib.addElementsToCache(txtInst[f], tFontsUpdateCacheList);
loadedTypekitCount++;
if(loadedTypekitCount == totalTypekitCount) {
lib.updateListCache(tFontsUpdateCacheList);
}
};
// symbols:
// helper functions:
function mc_symbol_clone() {
var clone = this._cloneProps(new this.constructor(this.mode, this.startPosition, this.loop));
clone.gotoAndStop(this.currentFrame);
clone.paused = this.paused;
clone.framerate = this.framerate;
return clone;
}
function getMCSymbolPrototype(symbol, nominalBounds, frameBounds) {
var prototype = cjs.extend(symbol, cjs.MovieClip);
prototype.clone = mc_symbol_clone;
prototype.nominalBounds = nominalBounds;
prototype.frameBounds = frameBounds;
return prototype;
}
(lib.unterkiefer = function(mode,startPosition,loop) {
this.initialize(mode,startPosition,loop,{});
// Ebene 1
this.shape = new cjs.Shape();
this.shape.graphics.f().s("#000000").ss(1,1,1).p("AAYCVQgSAJgLABQgQgBgPgKQgWgOgWgbQgwgzgXg7Qg9ibDSAAQDdgJhGCiQgaA9g2AzQgaAagTAQg");
this.shape_1 = new cjs.Shape();
this.shape_1.graphics.f().s("#000000").ss(0.3,1,1).p("AB/gFQgXAzgtArQgWAXgRAMQgOAIgLABQgNgBgNgJQgSgLgTgXQgogrgUgxQgziCCyABQC7gIg7CHg");
this.shape_1.setTransform(0.3,-1);
this.shape_2 = new cjs.Shape();
this.shape_2.graphics.rf(["rgba(100,19,19,0.988)","rgba(163,33,33,0.988)","#000000"],[0,0.325,0.843],-0.4,11.2,0,-0.7,11.2,21.1).s().p("AgfB7QgSgLgTgXQgogrgUgxQgziCCyABQC7gIg7CHQgXAzgtArQgWAXgRAMQgOAIgLABQgNgBgNgJg");
this.shape_2.setTransform(0.3,-1);
this.shape_3 = new cjs.Shape();
this.shape_3.graphics.rf(["#1D9F92","#000000"],[0.494,1],0.8,4.3,0,0.8,4.3,17.9).s().p("AgkCUQgWgOgWgbQgwgzgXg7Qg9ibDSAAQDdgJhGCiQgaA9g2AzQgaAagTAQQgSAJgLABQgQgBgPgKgAh+gNQAUAxApArQASAXATALQANAIANACQAKgBAPgJQARgMAWgWQAtgrAWgzQA8iHi9AHIAAAAQixAAAzCCg");
this.timeline.addTween(cjs.Tween.get({}).to({state:[{t:this.shape_3},{t:this.shape_2},{t:this.shape_1},{t:this.shape}]}).wait(1));
}).prototype = getMCSymbolPrototype(lib.unterkiefer, new cjs.Rectangle(-17.5,-16.9,35.2,33.8), null);
(lib.pupillen = function(mode,startPosition,loop) {
this.initialize(mode,startPosition,loop,{});
// Ebene 1
this.shape = new cjs.Shape();
this.shape.graphics.f("#000000").s().p("AgGARQgMgFgHgIQgEgIADgGQADgHAJgDQALgBALAFQALAFAGAIQAFAIgDAHQgDAHgKACIgEAAQgIAAgIgEg");
this.shape.setTransform(-16.8,0);
this.timeline.addTween(cjs.Tween.get(this.shape).wait(1));
}).prototype = getMCSymbolPrototype(lib.pupillen, new cjs.Rectangle(-19.6,-2.1,5.6,4.3), null);
(lib.nasenloch = function(mode,startPosition,loop) {
this.initialize(mode,startPosition,loop,{});
// Ebene 2
this.shape = new cjs.Shape();
this.shape.graphics.f("#000000").s().p("AgGALQgCgEAAgHQAAgGACgFQADgEADAAQAEAAACAEQAEAFAAAGQAAAHgEAEQgCAFgEAAQgDAAgDgFg");
this.shape.setTransform(1.1,-0.5,1.451,1.451);
this.timeline.addTween(cjs.Tween.get(this.shape).wait(1));
// Ebene 1
this.shape_1 = new cjs.Shape();
this.shape_1.graphics.rf(["rgba(47,133,121,0.988)","#000000"],[0.694,1],0,0.4,0,0,0.4,2).s().p("AgOAUQgGgIAAgMQAAgLAGgIQAGgIAIAAQAJAAAGAIQAGAIAAALQAAAMgGAIQgGAIgJAAQgIAAgGgIg");
this.shape_1.setTransform(1,-1.3,1.451,1.451);
this.timeline.addTween(cjs.Tween.get(this.shape_1).wait(1));
}).prototype = p = new cjs.MovieClip();
p.nominalBounds = new cjs.Rectangle(-2.1,-5.3,6.2,8.2);
(lib.kugel = function(mode,startPosition,loop) {
this.initialize(mode,startPosition,loop,{});
// Ebene 1
this.shape = new cjs.Shape();
this.shape.graphics.f().s("#000000").ss(0.1,0,0,42).p("AAmAAQAAAPgMALQgLAMgPAAQgPAAgLgMQgLgLAAgPQAAgPALgLQALgLAPAAQAPAAALALQAMALAAAPg");
this.shape_1 = new cjs.Shape();
this.shape_1.graphics.rf(["#0CBFBF","#000000","#2F1038"],[0,0.784,0.914],-1,-1,0,-1,-1,3.9).s().p("AgaAaQgLgKAAgQQAAgOALgMQAMgLAOAAQAQAAAKALQAMAMAAAOQAAAQgMAKQgKAMgQAAQgOAAgMgMg");
this.timeline.addTween(cjs.Tween.get({}).to({state:[{t:this.shape_1},{t:this.shape}]}).wait(1));
}).prototype = getMCSymbolPrototype(lib.kugel, new cjs.Rectangle(-4.8,-4.8,9.6,9.6), null);
(lib.Ball = function(mode,startPosition,loop) {
this.initialize(mode,startPosition,loop,{});
// Ebene 2
this.shape = new cjs.Shape();
this.shape.graphics.f().s("#000000").ss(1,0,0,42).p("AD6AAQAABohJBJQhJBJhoAAQhnAAhJhJQhJhJAAhoQAAhnBJhJQBJhJBnAAQBoAABJBJQBJBJAABng");
this.shape_1 = new cjs.Shape();
this.shape_1.graphics.rf(["#00FFCD","#000000","#9500CB"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
this.shape_2 = new cjs.Shape();
this.shape_2.graphics.f().s("#000000").ss(1,0,0,42).p("Aj5AAQAAhnBJhJQBJhJBnAAQBoAABJBJQBJBJAABnQAABohJBJQhJBJhoAAQhnAAhJhJQhJhJAAhog");
this.shape_3 = new cjs.Shape();
this.shape_3.graphics.rf(["#24FBB0","#000000","#9500CB"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
this.shape_4 = new cjs.Shape();
this.shape_4.graphics.rf(["#49F692","#000000","#9500CB"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
this.shape_5 = new cjs.Shape();
this.shape_5.graphics.rf(["#6DF275","#000000","#9500CB"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
this.shape_6 = new cjs.Shape();
this.shape_6.graphics.rf(["#92ED58","#000000","#9500CB"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
this.shape_7 = new cjs.Shape();
this.shape_7.graphics.rf(["#B6E93B","#000000","#9500CB"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
this.shape_8 = new cjs.Shape();
this.shape_8.graphics.rf(["#DBE41D","#000000","#9500CB"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
this.shape_9 = new cjs.Shape();
this.shape_9.graphics.rf(["#FFE000","#000000","#9500CB"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
this.shape_10 = new cjs.Shape();
this.shape_10.graphics.rf(["#FFC004","#000000","#801DC1"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
this.shape_11 = new cjs.Shape();
this.shape_11.graphics.rf(["#FFA008","#000000","#6A3AB6"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
this.shape_12 = new cjs.Shape();
this.shape_12.graphics.rf(["#FF800C","#000000","#5557AC"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
this.shape_13 = new cjs.Shape();
this.shape_13.graphics.rf(["#FF6010","#000000","#4074A1"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
this.shape_14 = new cjs.Shape();
this.shape_14.graphics.rf(["#FF4014","#000000","#2B9197"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
this.shape_15 = new cjs.Shape();
this.shape_15.graphics.rf(["#FF2018","#000000","#15AE8C"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
this.shape_16 = new cjs.Shape();
this.shape_16.graphics.rf(["#FF001C","#000000","#00CB82"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
this.shape_17 = new cjs.Shape();
this.shape_17.graphics.rf(["#E8172C","#000000","#0EB989"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
this.shape_18 = new cjs.Shape();
this.shape_18.graphics.rf(["#D12E3C","#000000","#1BA68F"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
this.shape_19 = new cjs.Shape();
this.shape_19.graphics.rf(["#B9464C","#000000","#299496"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
this.shape_20 = new cjs.Shape();
this.shape_20.graphics.rf(["#A25D5C","#000000","#36819D"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
this.shape_21 = new cjs.Shape();
this.shape_21.graphics.rf(["#8B746C","#000000","#446FA3"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
this.shape_22 = new cjs.Shape();
this.shape_22.graphics.rf(["#748B7D","#000000","#515CAA"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
this.shape_23 = new cjs.Shape();
this.shape_23.graphics.rf(["#5DA28D","#000000","#5F4AB0"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
this.shape_24 = new cjs.Shape();
this.shape_24.graphics.rf(["#46B99D","#000000","#6C37B7"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
this.shape_25 = new cjs.Shape();
this.shape_25.graphics.rf(["#2ED1AD","#000000","#7A25BE"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
this.shape_26 = new cjs.Shape();
this.shape_26.graphics.rf(["#17E8BD","#000000","#8712C4"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
this.timeline.addTween(cjs.Tween.get({}).to({state:[{t:this.shape_1},{t:this.shape}]}).to({state:[{t:this.shape_3},{t:this.shape_2}]},1).to({state:[{t:this.shape_4},{t:this.shape_2}]},1).to({state:[{t:this.shape_5},{t:this.shape_2}]},1).to({state:[{t:this.shape_6},{t:this.shape_2}]},1).to({state:[{t:this.shape_7},{t:this.shape_2}]},1).to({state:[{t:this.shape_8},{t:this.shape_2}]},1).to({state:[{t:this.shape_9},{t:this.shape}]},1).to({state:[{t:this.shape_10},{t:this.shape_2}]},1).to({state:[{t:this.shape_11},{t:this.shape_2}]},1).to({state:[{t:this.shape_12},{t:this.shape_2}]},1).to({state:[{t:this.shape_13},{t:this.shape_2}]},1).to({state:[{t:this.shape_14},{t:this.shape_2}]},1).to({state:[{t:this.shape_15},{t:this.shape_2}]},1).to({state:[{t:this.shape_16},{t:this.shape}]},1).to({state:[{t:this.shape_17},{t:this.shape_2}]},1).to({state:[{t:this.shape_18},{t:this.shape_2}]},1).to({state:[{t:this.shape_19},{t:this.shape_2}]},1).to({state:[{t:this.shape_20},{t:this.shape_2}]},1).to({state:[{t:this.shape_21},{t:this.shape_2}]},1).to({state:[{t:this.shape_22},{t:this.shape_2}]},1).to({state:[{t:this.shape_23},{t:this.shape_2}]},1).to({state:[{t:this.shape_24},{t:this.shape_2}]},1).to({state:[{t:this.shape_25},{t:this.shape_2}]},1).to({state:[{t:this.shape_26},{t:this.shape_2}]},1).to({state:[{t:this.shape_1},{t:this.shape}]},1).wait(1));
}).prototype = p = new cjs.MovieClip();
p.nominalBounds = new cjs.Rectangle(-26,-26,52,52);
(lib.auge = function(mode,startPosition,loop) {
this.initialize(mode,startPosition,loop,{});
// pupillen
this.instance = new lib.pupillen();
this.instance.parent = this;
this.instance.setTransform(17.1,0.7);
this.timeline.addTween(cjs.Tween.get(this.instance).wait(1));
// Ebene 3
this.shape = new cjs.Shape();
this.shape.graphics.f().s("#000000").ss(0.4,1,1).p("ABIAfQgHARgaADQgbADgdgMQgdgNgQgWQgQgUAHgQQAIgSAagDQAagDAdANQAeAMAQAVQAPAVgHARg");
this.shape.setTransform(-0.4,-1.7);
this.shape_1 = new cjs.Shape();
this.shape_1.graphics.rf(["#CBFFFA","#20262E"],[0.494,1],-0.2,0.7,0,-0.2,0.7,8.9).s().p("AgWA3QgigPgRgaQgSgaAKgXQAJgWAggGQAfgFAhAOQAhAPARAaQASAagJAWQgKAXggAFQgJACgJAAQgXAAgWgKgAgpgqQgaAEgIARQgHARAQAUQAQAVAdANQAdANAbgEQAagDAHgQQAHgSgPgVQgQgUgegNQgXgKgWAAIgKAAg");
this.shape_1.setTransform(0,-2.6);
this.timeline.addTween(cjs.Tween.get({}).to({state:[{t:this.shape_1},{t:this.shape}]}).wait(1));
// Ebene 1
this.shape_2 = new cjs.Shape();
this.shape_2.graphics.f().s("#000000").ss(0.4,1,1).p("ABTAjQgKAXggAFQgfAGgggOQgigPgRgaQgSgaAKgXQAJgWAggGQAfgFAhAOQAhAPARAaQASAagJAWg");
this.shape_2.setTransform(0,-2.6);
this.shape_3 = new cjs.Shape();
this.shape_3.graphics.rf(["#FFFFFF","#44344A"],[0.349,1],0,0.1,0,0,0.1,8.3).s().p("AgRAqQgdgNgQgWQgQgUAHgQQAIgSAagDQAagDAdANQAeAMAQAVQAPAVgHARQgHARgaADIgMABQgVAAgXgKg");
this.shape_3.setTransform(-0.4,-1.7);
this.timeline.addTween(cjs.Tween.get({}).to({state:[{t:this.shape_3},{t:this.shape_2}]}).wait(1));
}).prototype = getMCSymbolPrototype(lib.auge, new cjs.Rectangle(-9.6,-10.1,19.2,15.1), null);
(lib.SnakeHead = function(mode,startPosition,loop) {
this.initialize(mode,startPosition,loop,{});
// kopf
this.instance = new lib.auge();
this.instance.parent = this;
this.instance.setTransform(18.1,-12.4,1.251,1.251,0,0,180);
this.instance_1 = new lib.auge();
this.instance_1.parent = this;
this.instance_1.setTransform(-18,-12.4,1.251,1.251);
this.instance_2 = new lib.nasenloch("synched",0);
this.instance_2.parent = this;
this.instance_2.setTransform(-6.3,3.5,0.926,0.926,-30);
this.instance_3 = new lib.nasenloch("synched",0);
this.instance_3.parent = this;
this.instance_3.setTransform(5.2,2.5,0.926,0.926,30);
this.shape = new cjs.Shape();
this.shape.graphics.f().s("#000000").ss(1,0,0,42).p("AiJiqQAsgHAsgDQAsgDArACQAtADArAKQAvALAzgIQAJgCAKABQAgAEALAgQAPArgIAuQgFAigLAfQgEANgFAMQgTAtgoAcQglAZgrAOQgrAPgtAFQguAFgugHQgwgFgvgTQgtgQgkgiQgigggQgrQgBgDgBgDQgNgmgDgqQgCgrANgqQAJgfAhgDQAxAGAwAAQAEAAAEgBg");
this.shape.setTransform(0,-7.3);
this.shape_1 = new cjs.Shape();
this.shape_1.graphics.rf(["#0CBFBF","#000000","#2F1038"],[0,0.784,0.914],-0.7,-1.8,0,-0.7,-1.8,33.9).s().p("AgzCzQgwgFgvgTQgtgQgkgiQgigggQgrIgCgGQgNgmgDgqQgCgrANgqQAJgfAhgDQAxAGAwAAIAIgBQAsgHAsgDQAsgDArACQAtADArAKQAvALAzgIQAJgCAKABQAgAEALAgQAPArgIAuQgFAigLAfIgJAZQgTAtgoAcQglAZgrAOQgrAPgtAFQgTACgTAAQgbAAgbgEg");
this.shape_1.setTransform(0,-7.3);
this.timeline.addTween(cjs.Tween.get({}).to({state:[{t:this.shape_1},{t:this.shape},{t:this.instance_3},{t:this.instance_2},{t:this.instance_1},{t:this.instance}]}).wait(1));
// Ebene 5
this.instance_4 = new lib.kugel();
this.instance_4.parent = this;
this.instance_4.setTransform(59.9,-71.7,1,1,0,0,180);
this.instance_5 = new lib.kugel();
this.instance_5.parent = this;
this.instance_5.setTransform(-55.2,-71.7);
this.shape_2 = new cjs.Shape();
this.shape_2.graphics.f().s("#666666").ss(1,0,0,42).p("ABtEEQgbiZB4iRQB7iUDahFAhsEEQAbiZh4iRQh7iUjahF");
this.shape_2.setTransform(2.3,-44.9);
this.timeline.addTween(cjs.Tween.get({}).to({state:[{t:this.shape_2},{t:this.instance_5},{t:this.instance_4}]}).wait(1));
// maul
this.instance_6 = new lib.unterkiefer();
this.instance_6.parent = this;
this.instance_6.setTransform(0,9.9);
this.timeline.addTween(cjs.Tween.get(this.instance_6).wait(1));
}).prototype = getMCSymbolPrototype(lib.SnakeHead, new cjs.Rectangle(-59.1,-75.5,122.8,101.9), null);
// stage content:
(lib.snake = function(mode,startPosition,loop) {
this.initialize(mode,startPosition,loop,{});
// timeline functions:
this.frame_0 = function() {
var anzahl = 30;
var abstand = 15;
var ball = new Object();
ball[0] = new lib.SnakeHead();
ball[0].x = 500;
ball[0].y = 50;
this.addChild(ball[0]);
for(i = 1; i < anzahl; i++)
{
ball[i] = new lib.Ball();
ball[i].x = ball[i-1].x - abstand;
ball[i].y = 50;
ball[i].scaleX = 1 - i / anzahl;
ball[i].scaleY = 1 - i / anzahl;
ball[i].gotoAndPlay(i);
this.addChild(ball[i]);
}
//die zweite Schleife dient dazu die Stapelreihenfolge umzukehren
for(i = anzahl; i >= 0; i--)
{
this.addChild(ball[i]);
}
this.addEventListener("tick",mover.bind(this));
function mover()
{
var p = this.globalToLocal(this.stage.mouseX, this.stage.mouseY);
ball[0].x = ball[0].x + (p.x - ball[0].x) / 15;
ball[0].y = ball[0].y + (p.y - ball[0].y) / 15;
for (i = 1; i < anzahl; i++)
{
//horizontaler Abstand zum vorigen Element,
distX = ball[i - 1].x - ball[i].x;
//vertikaler Abstand zum vorigen Element
distY = ball[i - 1].y - ball[i].y;
//Abstand zum vorigen Element (Satz des Pythagoras a² * b² = c²)
dist = Math.sqrt(distX * distX + distY * distY);
//Verhältnis horizontaler Abstand zum wirklichen Abstand
cx = distX / dist;
cy = distY / dist;
//der gewünschte Abstand ist "abstand", der momentane Abstand ist "dist"
//Das Verhältnis horizontaler Abstand zu momenten Abstand ist "cx"
//Nun kann man anhand des Verhältnis cx den gewünschten X-Abstand ausrechnen
distX_new = cx * (abstand/(i*0.7)+5);
//auf gleiche Weise wird auch der gewünschte Y-Abstand errechnet
distY_new = cy * (abstand / ( i* 0.7)+5);
//Die neue Position wird gesetzt, der errechnete Abstand wird von der Position
//des vorigen Elementes abgezogen
ball[i].x = ball[i - 1].x - distX_new;
ball[i].y = ball[i - 1].y - distY_new;
}
}
}
// actions tween:
this.timeline.addTween(cjs.Tween.get(this).call(this.frame_0).wait(1));
}).prototype = p = new cjs.MovieClip();
p.nominalBounds = null;
// library properties:
lib.properties = {
id: 'A159DC6E08C1F34A8C922AA70F875570',
width: 800,
height: 800,
fps: 24,
color: "#000000",
opacity: 1.00,
webfonts: {},
manifest: [],
preloads: []
};
// bootstrap callback support:
(lib.Stage = function(canvas) {
createjs.Stage.call(this, canvas);
}).prototype = p = new createjs.Stage();
p.setAutoPlay = function(autoPlay) {
this.tickEnabled = autoPlay;
}
p.play = function() { this.tickEnabled = true; this.getChildAt(0).gotoAndPlay(this.getTimelinePosition()) }
p.stop = function(ms) { if(ms) this.seek(ms); this.tickEnabled = false; }
p.seek = function(ms) { this.tickEnabled = true; this.getChildAt(0).gotoAndStop(lib.properties.fps * ms / 1000); }
p.getDuration = function() { return this.getChildAt(0).totalFrames / lib.properties.fps * 1000; }
p.getTimelinePosition = function() { return this.getChildAt(0).currentFrame / lib.properties.fps * 1000; }
an.bootcompsLoaded = an.bootcompsLoaded || [];
if(!an.bootstrapListeners) {
an.bootstrapListeners=[];
}
an.bootstrapCallback=function(fnCallback) {
an.bootstrapListeners.push(fnCallback);
if(an.bootcompsLoaded.length > 0) {
for(var i=0; i<an.bootcompsLoaded.length; ++i) {
fnCallback(an.bootcompsLoaded[i]);
}
}
};
an.compositions = an.compositions || {};
an.compositions['A159DC6E08C1F34A8C922AA70F875570'] = {
getStage: function() { return exportRoot.getStage(); },
getLibrary: function() { return lib; },
getSpriteSheet: function() { return ss; },
getImages: function() { return img; }
};
an.compositionLoaded = function(id) {
an.bootcompsLoaded.push(id);
for(var j=0; j<an.bootstrapListeners.length; j++) {
an.bootstrapListeners[j](id);
}
}
an.getComposition = function(id) {
return an.compositions[id];
}
})(createjs = createjs||{}, AdobeAn = AdobeAn||{});
var createjs, AdobeAn;
</script>
<script>
var canvas, stage, exportRoot, anim_container, dom_overlay_container, fnStartAnimation;
function init() {
canvas = document.getElementById("canvas");
anim_container = document.getElementById("animation_container");
dom_overlay_container = document.getElementById("dom_overlay_container");
var comp=AdobeAn.getComposition("A159DC6E08C1F34A8C922AA70F875570");
var lib=comp.getLibrary();
handleComplete({},comp);
}
function handleComplete(evt,comp) {
//This function is always called, irrespective of the content. You can use the variable "stage" after it is created in token create_stage.
var lib=comp.getLibrary();
var ss=comp.getSpriteSheet();
var preloaderDiv = document.getElementById("_preload_div_");
preloaderDiv.style.display = 'none';
canvas.style.display = 'block';
exportRoot = new lib.snake();
stage = new lib.Stage(canvas);
stage.addChild(exportRoot);
fnStartAnimation = function() {
createjs.Ticker.setFPS(lib.properties.fps);
createjs.Ticker.addEventListener("tick", stage);
}
//Code to support hidpi screens and responsive scaling.
function makeResponsive(isResp, respDim, isScale, scaleType) {
var lastW, lastH, lastS=1;
window.addEventListener('resize', resizeCanvas);
resizeCanvas();
function resizeCanvas() {
var w = lib.properties.width, h = lib.properties.height;
var iw = window.innerWidth, ih=window.innerHeight;
var pRatio = window.devicePixelRatio || 1, xRatio=iw/w, yRatio=ih/h, sRatio=1;
if(isResp) {
if((respDim=='width'&&lastW==iw) || (respDim=='height'&&lastH==ih)) {
sRatio = lastS;
}
else if(!isScale) {
if(iw<w || ih<h)
sRatio = Math.min(xRatio, yRatio);
}
else if(scaleType==1) {
sRatio = Math.min(xRatio, yRatio);
}
else if(scaleType==2) {
sRatio = Math.max(xRatio, yRatio);
}
}
canvas.width = w*pRatio*sRatio;
canvas.height = h*pRatio*sRatio;
canvas.style.width = anim_container.style.width = dom_overlay_container.style.width = preloaderDiv.style.width = w*sRatio+'px';
canvas.style.height = anim_container.style.height = dom_overlay_container.style.height = preloaderDiv.style.height = h*sRatio+'px';
stage.scaleX = pRatio*sRatio;
stage.scaleY = pRatio*sRatio;
lastW = iw; lastH = ih; lastS = sRatio;
}
}
makeResponsive(true,'both',true,1);
AdobeAn.compositionLoaded(lib.properties.id);
fnStartAnimation();
}
</script>
<!-- write your code here -->
</head>
<body onload="init();" style="margin:0px;">
<div id="animation_container" style="background-color:rgba(0, 0, 0, 1.00); width:800px; height:800px">
<canvas id="canvas" width="800" height="800" style="position: absolute; display: none; background-color:rgba(0, 0, 0, 1.00);"></canvas>
<div id="dom_overlay_container" style="pointer-events:none; overflow:hidden; width:800px; height:800px; position: absolute; left: 0px; top: 0px; display: none;">
</div>
</div>
<div id='_preload_div_' style='display: inline-block; height:800px; width: 800px; vertical-align=middle;position:absolute;left:0px;top:0px;text-align: center;'> <span style='display: inline-block; height: 100%; vertical-align: middle;'></span> <img src=https://on-design.de/html5/snake/images/_preloader.gif style='vertical-align: middle; max-height: 100%'/></div>
</body>
</html>
- <!DOCTYPE html>
-
- <html>
- <head>
- <meta charset="UTF-8">
- <meta name="authoring-tool" content="Adobe_Animate_CC">
- <title>snake</title>
- <!-- write your code here -->
- <style>
- body {background-color: #000; margin: 0px; }
- #animation_container, #_preload_div_ {
- position:absolute;
- margin:auto;
- left:0;right:0;
- top:0;bottom:0;
- }
- </style>
- <script src="https://code.createjs.com/createjs-2015.11.26.min.js"></script>
- <script>
- (function (cjs, an) {
- var p; // shortcut to reference prototypes
- var lib={};var ss={};var img={};
- lib.webFontTxtInst = {};
- var loadedTypekitCount = 0;
- var loadedGoogleCount = 0;
- var gFontsUpdateCacheList = [];
- var tFontsUpdateCacheList = [];
- lib.ssMetadata = [];
- lib.updateListCache = function (cacheList) {
- for(var i = 0; i < cacheList.length; i++) {
- if(cacheList[i].cacheCanvas)
- cacheList[i].updateCache();
- }
- };
- lib.addElementsToCache = function (textInst, cacheList) {
- var cur = textInst;
- while(cur != null && cur != exportRoot) {
- if(cacheList.indexOf(cur) != -1)
- break;
- cur = cur.parent;
- }
- if(cur != exportRoot) {
- var cur2 = textInst;
- var index = cacheList.indexOf(cur);
- while(cur2 != null && cur2 != cur) {
- cacheList.splice(index, 0, cur2);
- cur2 = cur2.parent;
- index++;
- }
- }
- else {
- cur = textInst;
- while(cur != null && cur != exportRoot) {
- cacheList.push(cur);
- cur = cur.parent;
- }
- }
- };
- lib.gfontAvailable = function(family, totalGoogleCount) {
- lib.properties.webfonts[family] = true;
- var txtInst = lib.webFontTxtInst && lib.webFontTxtInst[family] || [];
- for(var f = 0; f < txtInst.length; ++f)
- lib.addElementsToCache(txtInst[f], gFontsUpdateCacheList);
- loadedGoogleCount++;
- if(loadedGoogleCount == totalGoogleCount) {
- lib.updateListCache(gFontsUpdateCacheList);
- }
- };
- lib.tfontAvailable = function(family, totalTypekitCount) {
- lib.properties.webfonts[family] = true;
- var txtInst = lib.webFontTxtInst && lib.webFontTxtInst[family] || [];
- for(var f = 0; f < txtInst.length; ++f)
- lib.addElementsToCache(txtInst[f], tFontsUpdateCacheList);
- loadedTypekitCount++;
- if(loadedTypekitCount == totalTypekitCount) {
- lib.updateListCache(tFontsUpdateCacheList);
- }
- };
- // symbols:
- // helper functions:
- function mc_symbol_clone() {
- var clone = this._cloneProps(new this.constructor(this.mode, this.startPosition, this.loop));
- clone.gotoAndStop(this.currentFrame);
- clone.paused = this.paused;
- clone.framerate = this.framerate;
- return clone;
- }
- function getMCSymbolPrototype(symbol, nominalBounds, frameBounds) {
- var prototype = cjs.extend(symbol, cjs.MovieClip);
- prototype.clone = mc_symbol_clone;
- prototype.nominalBounds = nominalBounds;
- prototype.frameBounds = frameBounds;
- return prototype;
- }
- (lib.unterkiefer = function(mode,startPosition,loop) {
- this.initialize(mode,startPosition,loop,{});
- // Ebene 1
- this.shape = new cjs.Shape();
- this.shape.graphics.f().s("#000000").ss(1,1,1).p("AAYCVQgSAJgLABQgQgBgPgKQgWgOgWgbQgwgzgXg7Qg9ibDSAAQDdgJhGCiQgaA9g2AzQgaAagTAQg");
- this.shape_1 = new cjs.Shape();
- this.shape_1.graphics.f().s("#000000").ss(0.3,1,1).p("AB/gFQgXAzgtArQgWAXgRAMQgOAIgLABQgNgBgNgJQgSgLgTgXQgogrgUgxQgziCCyABQC7gIg7CHg");
- this.shape_1.setTransform(0.3,-1);
- this.shape_2 = new cjs.Shape();
- this.shape_2.graphics.rf(["rgba(100,19,19,0.988)","rgba(163,33,33,0.988)","#000000"],[0,0.325,0.843],-0.4,11.2,0,-0.7,11.2,21.1).s().p("AgfB7QgSgLgTgXQgogrgUgxQgziCCyABQC7gIg7CHQgXAzgtArQgWAXgRAMQgOAIgLABQgNgBgNgJg");
- this.shape_2.setTransform(0.3,-1);
- this.shape_3 = new cjs.Shape();
- this.shape_3.graphics.rf(["#1D9F92","#000000"],[0.494,1],0.8,4.3,0,0.8,4.3,17.9).s().p("AgkCUQgWgOgWgbQgwgzgXg7Qg9ibDSAAQDdgJhGCiQgaA9g2AzQgaAagTAQQgSAJgLABQgQgBgPgKgAh+gNQAUAxApArQASAXATALQANAIANACQAKgBAPgJQARgMAWgWQAtgrAWgzQA8iHi9AHIAAAAQixAAAzCCg");
- this.timeline.addTween(cjs.Tween.get({}).to({state:[{t:this.shape_3},{t:this.shape_2},{t:this.shape_1},{t:this.shape}]}).wait(1));
- }).prototype = getMCSymbolPrototype(lib.unterkiefer, new cjs.Rectangle(-17.5,-16.9,35.2,33.8), null);
- (lib.pupillen = function(mode,startPosition,loop) {
- this.initialize(mode,startPosition,loop,{});
- // Ebene 1
- this.shape = new cjs.Shape();
- this.shape.graphics.f("#000000").s().p("AgGARQgMgFgHgIQgEgIADgGQADgHAJgDQALgBALAFQALAFAGAIQAFAIgDAHQgDAHgKACIgEAAQgIAAgIgEg");
- this.shape.setTransform(-16.8,0);
- this.timeline.addTween(cjs.Tween.get(this.shape).wait(1));
- }).prototype = getMCSymbolPrototype(lib.pupillen, new cjs.Rectangle(-19.6,-2.1,5.6,4.3), null);
- (lib.nasenloch = function(mode,startPosition,loop) {
- this.initialize(mode,startPosition,loop,{});
- // Ebene 2
- this.shape = new cjs.Shape();
- this.shape.graphics.f("#000000").s().p("AgGALQgCgEAAgHQAAgGACgFQADgEADAAQAEAAACAEQAEAFAAAGQAAAHgEAEQgCAFgEAAQgDAAgDgFg");
- this.shape.setTransform(1.1,-0.5,1.451,1.451);
- this.timeline.addTween(cjs.Tween.get(this.shape).wait(1));
- // Ebene 1
- this.shape_1 = new cjs.Shape();
- this.shape_1.graphics.rf(["rgba(47,133,121,0.988)","#000000"],[0.694,1],0,0.4,0,0,0.4,2).s().p("AgOAUQgGgIAAgMQAAgLAGgIQAGgIAIAAQAJAAAGAIQAGAIAAALQAAAMgGAIQgGAIgJAAQgIAAgGgIg");
- this.shape_1.setTransform(1,-1.3,1.451,1.451);
- this.timeline.addTween(cjs.Tween.get(this.shape_1).wait(1));
- }).prototype = p = new cjs.MovieClip();
- p.nominalBounds = new cjs.Rectangle(-2.1,-5.3,6.2,8.2);
- (lib.kugel = function(mode,startPosition,loop) {
- this.initialize(mode,startPosition,loop,{});
- // Ebene 1
- this.shape = new cjs.Shape();
- this.shape.graphics.f().s("#000000").ss(0.1,0,0,42).p("AAmAAQAAAPgMALQgLAMgPAAQgPAAgLgMQgLgLAAgPQAAgPALgLQALgLAPAAQAPAAALALQAMALAAAPg");
- this.shape_1 = new cjs.Shape();
- this.shape_1.graphics.rf(["#0CBFBF","#000000","#2F1038"],[0,0.784,0.914],-1,-1,0,-1,-1,3.9).s().p("AgaAaQgLgKAAgQQAAgOALgMQAMgLAOAAQAQAAAKALQAMAMAAAOQAAAQgMAKQgKAMgQAAQgOAAgMgMg");
- this.timeline.addTween(cjs.Tween.get({}).to({state:[{t:this.shape_1},{t:this.shape}]}).wait(1));
- }).prototype = getMCSymbolPrototype(lib.kugel, new cjs.Rectangle(-4.8,-4.8,9.6,9.6), null);
- (lib.Ball = function(mode,startPosition,loop) {
- this.initialize(mode,startPosition,loop,{});
- // Ebene 2
- this.shape = new cjs.Shape();
- this.shape.graphics.f().s("#000000").ss(1,0,0,42).p("AD6AAQAABohJBJQhJBJhoAAQhnAAhJhJQhJhJAAhoQAAhnBJhJQBJhJBnAAQBoAABJBJQBJBJAABng");
- this.shape_1 = new cjs.Shape();
- this.shape_1.graphics.rf(["#00FFCD","#000000","#9500CB"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
- this.shape_2 = new cjs.Shape();
- this.shape_2.graphics.f().s("#000000").ss(1,0,0,42).p("Aj5AAQAAhnBJhJQBJhJBnAAQBoAABJBJQBJBJAABnQAABohJBJQhJBJhoAAQhnAAhJhJQhJhJAAhog");
- this.shape_3 = new cjs.Shape();
- this.shape_3.graphics.rf(["#24FBB0","#000000","#9500CB"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
- this.shape_4 = new cjs.Shape();
- this.shape_4.graphics.rf(["#49F692","#000000","#9500CB"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
- this.shape_5 = new cjs.Shape();
- this.shape_5.graphics.rf(["#6DF275","#000000","#9500CB"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
- this.shape_6 = new cjs.Shape();
- this.shape_6.graphics.rf(["#92ED58","#000000","#9500CB"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
- this.shape_7 = new cjs.Shape();
- this.shape_7.graphics.rf(["#B6E93B","#000000","#9500CB"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
- this.shape_8 = new cjs.Shape();
- this.shape_8.graphics.rf(["#DBE41D","#000000","#9500CB"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
- this.shape_9 = new cjs.Shape();
- this.shape_9.graphics.rf(["#FFE000","#000000","#9500CB"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
- this.shape_10 = new cjs.Shape();
- this.shape_10.graphics.rf(["#FFC004","#000000","#801DC1"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
- this.shape_11 = new cjs.Shape();
- this.shape_11.graphics.rf(["#FFA008","#000000","#6A3AB6"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
- this.shape_12 = new cjs.Shape();
- this.shape_12.graphics.rf(["#FF800C","#000000","#5557AC"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
- this.shape_13 = new cjs.Shape();
- this.shape_13.graphics.rf(["#FF6010","#000000","#4074A1"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
- this.shape_14 = new cjs.Shape();
- this.shape_14.graphics.rf(["#FF4014","#000000","#2B9197"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
- this.shape_15 = new cjs.Shape();
- this.shape_15.graphics.rf(["#FF2018","#000000","#15AE8C"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
- this.shape_16 = new cjs.Shape();
- this.shape_16.graphics.rf(["#FF001C","#000000","#00CB82"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
- this.shape_17 = new cjs.Shape();
- this.shape_17.graphics.rf(["#E8172C","#000000","#0EB989"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
- this.shape_18 = new cjs.Shape();
- this.shape_18.graphics.rf(["#D12E3C","#000000","#1BA68F"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
- this.shape_19 = new cjs.Shape();
- this.shape_19.graphics.rf(["#B9464C","#000000","#299496"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
- this.shape_20 = new cjs.Shape();
- this.shape_20.graphics.rf(["#A25D5C","#000000","#36819D"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
- this.shape_21 = new cjs.Shape();
- this.shape_21.graphics.rf(["#8B746C","#000000","#446FA3"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
- this.shape_22 = new cjs.Shape();
- this.shape_22.graphics.rf(["#748B7D","#000000","#515CAA"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
- this.shape_23 = new cjs.Shape();
- this.shape_23.graphics.rf(["#5DA28D","#000000","#5F4AB0"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
- this.shape_24 = new cjs.Shape();
- this.shape_24.graphics.rf(["#46B99D","#000000","#6C37B7"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
- this.shape_25 = new cjs.Shape();
- this.shape_25.graphics.rf(["#2ED1AD","#000000","#7A25BE"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
- this.shape_26 = new cjs.Shape();
- this.shape_26.graphics.rf(["#17E8BD","#000000","#8712C4"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
- this.timeline.addTween(cjs.Tween.get({}).to({state:[{t:this.shape_1},{t:this.shape}]}).to({state:[{t:this.shape_3},{t:this.shape_2}]},1).to({state:[{t:this.shape_4},{t:this.shape_2}]},1).to({state:[{t:this.shape_5},{t:this.shape_2}]},1).to({state:[{t:this.shape_6},{t:this.shape_2}]},1).to({state:[{t:this.shape_7},{t:this.shape_2}]},1).to({state:[{t:this.shape_8},{t:this.shape_2}]},1).to({state:[{t:this.shape_9},{t:this.shape}]},1).to({state:[{t:this.shape_10},{t:this.shape_2}]},1).to({state:[{t:this.shape_11},{t:this.shape_2}]},1).to({state:[{t:this.shape_12},{t:this.shape_2}]},1).to({state:[{t:this.shape_13},{t:this.shape_2}]},1).to({state:[{t:this.shape_14},{t:this.shape_2}]},1).to({state:[{t:this.shape_15},{t:this.shape_2}]},1).to({state:[{t:this.shape_16},{t:this.shape}]},1).to({state:[{t:this.shape_17},{t:this.shape_2}]},1).to({state:[{t:this.shape_18},{t:this.shape_2}]},1).to({state:[{t:this.shape_19},{t:this.shape_2}]},1).to({state:[{t:this.shape_20},{t:this.shape_2}]},1).to({state:[{t:this.shape_21},{t:this.shape_2}]},1).to({state:[{t:this.shape_22},{t:this.shape_2}]},1).to({state:[{t:this.shape_23},{t:this.shape_2}]},1).to({state:[{t:this.shape_24},{t:this.shape_2}]},1).to({state:[{t:this.shape_25},{t:this.shape_2}]},1).to({state:[{t:this.shape_26},{t:this.shape_2}]},1).to({state:[{t:this.shape_1},{t:this.shape}]},1).wait(1));
- }).prototype = p = new cjs.MovieClip();
- p.nominalBounds = new cjs.Rectangle(-26,-26,52,52);
- (lib.auge = function(mode,startPosition,loop) {
- this.initialize(mode,startPosition,loop,{});
- // pupillen
- this.instance = new lib.pupillen();
- this.instance.parent = this;
- this.instance.setTransform(17.1,0.7);
- this.timeline.addTween(cjs.Tween.get(this.instance).wait(1));
- // Ebene 3
- this.shape = new cjs.Shape();
- this.shape.graphics.f().s("#000000").ss(0.4,1,1).p("ABIAfQgHARgaADQgbADgdgMQgdgNgQgWQgQgUAHgQQAIgSAagDQAagDAdANQAeAMAQAVQAPAVgHARg");
- this.shape.setTransform(-0.4,-1.7);
- this.shape_1 = new cjs.Shape();
- this.shape_1.graphics.rf(["#CBFFFA","#20262E"],[0.494,1],-0.2,0.7,0,-0.2,0.7,8.9).s().p("AgWA3QgigPgRgaQgSgaAKgXQAJgWAggGQAfgFAhAOQAhAPARAaQASAagJAWQgKAXggAFQgJACgJAAQgXAAgWgKgAgpgqQgaAEgIARQgHARAQAUQAQAVAdANQAdANAbgEQAagDAHgQQAHgSgPgVQgQgUgegNQgXgKgWAAIgKAAg");
- this.shape_1.setTransform(0,-2.6);
- this.timeline.addTween(cjs.Tween.get({}).to({state:[{t:this.shape_1},{t:this.shape}]}).wait(1));
- // Ebene 1
- this.shape_2 = new cjs.Shape();
- this.shape_2.graphics.f().s("#000000").ss(0.4,1,1).p("ABTAjQgKAXggAFQgfAGgggOQgigPgRgaQgSgaAKgXQAJgWAggGQAfgFAhAOQAhAPARAaQASAagJAWg");
- this.shape_2.setTransform(0,-2.6);
- this.shape_3 = new cjs.Shape();
- this.shape_3.graphics.rf(["#FFFFFF","#44344A"],[0.349,1],0,0.1,0,0,0.1,8.3).s().p("AgRAqQgdgNgQgWQgQgUAHgQQAIgSAagDQAagDAdANQAeAMAQAVQAPAVgHARQgHARgaADIgMABQgVAAgXgKg");
- this.shape_3.setTransform(-0.4,-1.7);
- this.timeline.addTween(cjs.Tween.get({}).to({state:[{t:this.shape_3},{t:this.shape_2}]}).wait(1));
- }).prototype = getMCSymbolPrototype(lib.auge, new cjs.Rectangle(-9.6,-10.1,19.2,15.1), null);
- (lib.SnakeHead = function(mode,startPosition,loop) {
- this.initialize(mode,startPosition,loop,{});
- // kopf
- this.instance = new lib.auge();
- this.instance.parent = this;
- this.instance.setTransform(18.1,-12.4,1.251,1.251,0,0,180);
- this.instance_1 = new lib.auge();
- this.instance_1.parent = this;
- this.instance_1.setTransform(-18,-12.4,1.251,1.251);
- this.instance_2 = new lib.nasenloch("synched",0);
- this.instance_2.parent = this;
- this.instance_2.setTransform(-6.3,3.5,0.926,0.926,-30);
- this.instance_3 = new lib.nasenloch("synched",0);
- this.instance_3.parent = this;
- this.instance_3.setTransform(5.2,2.5,0.926,0.926,30);
- this.shape = new cjs.Shape();
- this.shape.graphics.f().s("#000000").ss(1,0,0,42).p("AiJiqQAsgHAsgDQAsgDArACQAtADArAKQAvALAzgIQAJgCAKABQAgAEALAgQAPArgIAuQgFAigLAfQgEANgFAMQgTAtgoAcQglAZgrAOQgrAPgtAFQguAFgugHQgwgFgvgTQgtgQgkgiQgigggQgrQgBgDgBgDQgNgmgDgqQgCgrANgqQAJgfAhgDQAxAGAwAAQAEAAAEgBg");
- this.shape.setTransform(0,-7.3);
- this.shape_1 = new cjs.Shape();
- this.shape_1.graphics.rf(["#0CBFBF","#000000","#2F1038"],[0,0.784,0.914],-0.7,-1.8,0,-0.7,-1.8,33.9).s().p("AgzCzQgwgFgvgTQgtgQgkgiQgigggQgrIgCgGQgNgmgDgqQgCgrANgqQAJgfAhgDQAxAGAwAAIAIgBQAsgHAsgDQAsgDArACQAtADArAKQAvALAzgIQAJgCAKABQAgAEALAgQAPArgIAuQgFAigLAfIgJAZQgTAtgoAcQglAZgrAOQgrAPgtAFQgTACgTAAQgbAAgbgEg");
- this.shape_1.setTransform(0,-7.3);
- this.timeline.addTween(cjs.Tween.get({}).to({state:[{t:this.shape_1},{t:this.shape},{t:this.instance_3},{t:this.instance_2},{t:this.instance_1},{t:this.instance}]}).wait(1));
- // Ebene 5
- this.instance_4 = new lib.kugel();
- this.instance_4.parent = this;
- this.instance_4.setTransform(59.9,-71.7,1,1,0,0,180);
- this.instance_5 = new lib.kugel();
- this.instance_5.parent = this;
- this.instance_5.setTransform(-55.2,-71.7);
- this.shape_2 = new cjs.Shape();
- this.shape_2.graphics.f().s("#666666").ss(1,0,0,42).p("ABtEEQgbiZB4iRQB7iUDahFAhsEEQAbiZh4iRQh7iUjahF");
- this.shape_2.setTransform(2.3,-44.9);
- this.timeline.addTween(cjs.Tween.get({}).to({state:[{t:this.shape_2},{t:this.instance_5},{t:this.instance_4}]}).wait(1));
- // maul
- this.instance_6 = new lib.unterkiefer();
- this.instance_6.parent = this;
- this.instance_6.setTransform(0,9.9);
- this.timeline.addTween(cjs.Tween.get(this.instance_6).wait(1));
- }).prototype = getMCSymbolPrototype(lib.SnakeHead, new cjs.Rectangle(-59.1,-75.5,122.8,101.9), null);
- // stage content:
- (lib.snake = function(mode,startPosition,loop) {
- this.initialize(mode,startPosition,loop,{});
- // timeline functions:
- this.frame_0 = function() {
- var anzahl = 30;
- var abstand = 15;
- var ball = new Object();
- ball[0] = new lib.SnakeHead();
- ball[0].x = 500;
- ball[0].y = 50;
- this.addChild(ball[0]);
-
-
-
- for(i = 1; i < anzahl; i++)
- {
- ball[i] = new lib.Ball();
- ball[i].x = ball[i-1].x - abstand;
- ball[i].y = 50;
- ball[i].scaleX = 1 - i / anzahl;
- ball[i].scaleY = 1 - i / anzahl;
- ball[i].gotoAndPlay(i);
- this.addChild(ball[i]);
- }
- //die zweite Schleife dient dazu die Stapelreihenfolge umzukehren
- for(i = anzahl; i >= 0; i--)
- {
- this.addChild(ball[i]);
- }
-
- this.addEventListener("tick",mover.bind(this));
-
- function mover()
- {
-
- var p = this.globalToLocal(this.stage.mouseX, this.stage.mouseY);
- ball[0].x = ball[0].x + (p.x - ball[0].x) / 15;
- ball[0].y = ball[0].y + (p.y - ball[0].y) / 15;
-
- for (i = 1; i < anzahl; i++)
- {
- //horizontaler Abstand zum vorigen Element,
- distX = ball[i - 1].x - ball[i].x;
- //vertikaler Abstand zum vorigen Element
- distY = ball[i - 1].y - ball[i].y;
- //Abstand zum vorigen Element (Satz des Pythagoras a² * b² = c²)
- dist = Math.sqrt(distX * distX + distY * distY);
- //Verhältnis horizontaler Abstand zum wirklichen Abstand
-
- cx = distX / dist;
- cy = distY / dist;
- //der gewünschte Abstand ist "abstand", der momentane Abstand ist "dist"
- //Das Verhältnis horizontaler Abstand zu momenten Abstand ist "cx"
- //Nun kann man anhand des Verhältnis cx den gewünschten X-Abstand ausrechnen
- distX_new = cx * (abstand/(i*0.7)+5);
- //auf gleiche Weise wird auch der gewünschte Y-Abstand errechnet
- distY_new = cy * (abstand / ( i* 0.7)+5);
- //Die neue Position wird gesetzt, der errechnete Abstand wird von der Position
- //des vorigen Elementes abgezogen
- ball[i].x = ball[i - 1].x - distX_new;
- ball[i].y = ball[i - 1].y - distY_new;
-
- }
-
- }
- }
- // actions tween:
- this.timeline.addTween(cjs.Tween.get(this).call(this.frame_0).wait(1));
- }).prototype = p = new cjs.MovieClip();
- p.nominalBounds = null;
- // library properties:
- lib.properties = {
- id: 'A159DC6E08C1F34A8C922AA70F875570',
- width: 800,
- height: 800,
- fps: 24,
- color: "#000000",
- opacity: 1.00,
- webfonts: {},
- manifest: [],
- preloads: []
- };
- // bootstrap callback support:
- (lib.Stage = function(canvas) {
- createjs.Stage.call(this, canvas);
- }).prototype = p = new createjs.Stage();
- p.setAutoPlay = function(autoPlay) {
- this.tickEnabled = autoPlay;
- }
- p.play = function() { this.tickEnabled = true; this.getChildAt(0).gotoAndPlay(this.getTimelinePosition()) }
- p.stop = function(ms) { if(ms) this.seek(ms); this.tickEnabled = false; }
- p.seek = function(ms) { this.tickEnabled = true; this.getChildAt(0).gotoAndStop(lib.properties.fps * ms / 1000); }
- p.getDuration = function() { return this.getChildAt(0).totalFrames / lib.properties.fps * 1000; }
- p.getTimelinePosition = function() { return this.getChildAt(0).currentFrame / lib.properties.fps * 1000; }
- an.bootcompsLoaded = an.bootcompsLoaded || [];
- if(!an.bootstrapListeners) {
- an.bootstrapListeners=[];
- }
- an.bootstrapCallback=function(fnCallback) {
- an.bootstrapListeners.push(fnCallback);
- if(an.bootcompsLoaded.length > 0) {
- for(var i=0; i<an.bootcompsLoaded.length; ++i) {
- fnCallback(an.bootcompsLoaded[i]);
- }
- }
- };
- an.compositions = an.compositions || {};
- an.compositions['A159DC6E08C1F34A8C922AA70F875570'] = {
- getStage: function() { return exportRoot.getStage(); },
- getLibrary: function() { return lib; },
- getSpriteSheet: function() { return ss; },
- getImages: function() { return img; }
- };
- an.compositionLoaded = function(id) {
- an.bootcompsLoaded.push(id);
- for(var j=0; j<an.bootstrapListeners.length; j++) {
- an.bootstrapListeners[j](id);
- }
- }
- an.getComposition = function(id) {
- return an.compositions[id];
- }
- })(createjs = createjs||{}, AdobeAn = AdobeAn||{});
- var createjs, AdobeAn;
- </script>
- <script>
- var canvas, stage, exportRoot, anim_container, dom_overlay_container, fnStartAnimation;
- function init() {
- canvas = document.getElementById("canvas");
- anim_container = document.getElementById("animation_container");
- dom_overlay_container = document.getElementById("dom_overlay_container");
- var comp=AdobeAn.getComposition("A159DC6E08C1F34A8C922AA70F875570");
- var lib=comp.getLibrary();
- handleComplete({},comp);
- }
- function handleComplete(evt,comp) {
- //This function is always called, irrespective of the content. You can use the variable "stage" after it is created in token create_stage.
- var lib=comp.getLibrary();
- var ss=comp.getSpriteSheet();
- var preloaderDiv = document.getElementById("_preload_div_");
- preloaderDiv.style.display = 'none';
- canvas.style.display = 'block';
- exportRoot = new lib.snake();
- stage = new lib.Stage(canvas);
- stage.addChild(exportRoot);
-
- fnStartAnimation = function() {
- createjs.Ticker.setFPS(lib.properties.fps);
- createjs.Ticker.addEventListener("tick", stage);
- }
- //Code to support hidpi screens and responsive scaling.
- function makeResponsive(isResp, respDim, isScale, scaleType) {
- var lastW, lastH, lastS=1;
- window.addEventListener('resize', resizeCanvas);
- resizeCanvas();
- function resizeCanvas() {
- var w = lib.properties.width, h = lib.properties.height;
- var iw = window.innerWidth, ih=window.innerHeight;
- var pRatio = window.devicePixelRatio || 1, xRatio=iw/w, yRatio=ih/h, sRatio=1;
- if(isResp) {
- if((respDim=='width'&&lastW==iw) || (respDim=='height'&&lastH==ih)) {
- sRatio = lastS;
- }
- else if(!isScale) {
- if(iw<w || ih<h)
- sRatio = Math.min(xRatio, yRatio);
- }
- else if(scaleType==1) {
- sRatio = Math.min(xRatio, yRatio);
- }
- else if(scaleType==2) {
- sRatio = Math.max(xRatio, yRatio);
- }
- }
- canvas.width = w*pRatio*sRatio;
- canvas.height = h*pRatio*sRatio;
- canvas.style.width = anim_container.style.width = dom_overlay_container.style.width = preloaderDiv.style.width = w*sRatio+'px';
- canvas.style.height = anim_container.style.height = dom_overlay_container.style.height = preloaderDiv.style.height = h*sRatio+'px';
- stage.scaleX = pRatio*sRatio;
- stage.scaleY = pRatio*sRatio;
- lastW = iw; lastH = ih; lastS = sRatio;
- }
- }
- makeResponsive(true,'both',true,1);
- AdobeAn.compositionLoaded(lib.properties.id);
- fnStartAnimation();
- }
- </script>
- <!-- write your code here -->
- </head>
- <body onload="init();" style="margin:0px;">
- <div id="animation_container" style="background-color:rgba(0, 0, 0, 1.00); width:800px; height:800px">
- <canvas id="canvas" width="800" height="800" style="position: absolute; display: none; background-color:rgba(0, 0, 0, 1.00);"></canvas>
- <div id="dom_overlay_container" style="pointer-events:none; overflow:hidden; width:800px; height:800px; position: absolute; left: 0px; top: 0px; display: none;">
- </div>
- </div>
- <div id='_preload_div_' style='display: inline-block; height:800px; width: 800px; vertical-align=middle;position:absolute;left:0px;top:0px;text-align: center;'> <span style='display: inline-block; height: 100%; vertical-align: middle;'></span> <img src=https://on-design.de/html5/snake/images/_preloader.gif style='vertical-align: middle; max-height: 100%'/></div>
- </body>
- </html>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="authoring-tool" content="Adobe_Animate_CC">
<title>snake</title>
<!-- write your code here -->
<style>
body {background-color: #000; margin: 0px; }
#animation_container, #_preload_div_ {
position:absolute;
margin:auto;
left:0;right:0;
top:0;bottom:0;
}
</style>
<script src="https://code.createjs.com/createjs-2015.11.26.min.js"></script>
<script>
(function (cjs, an) {
var p; // shortcut to reference prototypes
var lib={};var ss={};var img={};
lib.webFontTxtInst = {};
var loadedTypekitCount = 0;
var loadedGoogleCount = 0;
var gFontsUpdateCacheList = [];
var tFontsUpdateCacheList = [];
lib.ssMetadata = [];
lib.updateListCache = function (cacheList) {
for(var i = 0; i < cacheList.length; i++) {
if(cacheList[i].cacheCanvas)
cacheList[i].updateCache();
}
};
lib.addElementsToCache = function (textInst, cacheList) {
var cur = textInst;
while(cur != null && cur != exportRoot) {
if(cacheList.indexOf(cur) != -1)
break;
cur = cur.parent;
}
if(cur != exportRoot) {
var cur2 = textInst;
var index = cacheList.indexOf(cur);
while(cur2 != null && cur2 != cur) {
cacheList.splice(index, 0, cur2);
cur2 = cur2.parent;
index++;
}
}
else {
cur = textInst;
while(cur != null && cur != exportRoot) {
cacheList.push(cur);
cur = cur.parent;
}
}
};
lib.gfontAvailable = function(family, totalGoogleCount) {
lib.properties.webfonts[family] = true;
var txtInst = lib.webFontTxtInst && lib.webFontTxtInst[family] || [];
for(var f = 0; f < txtInst.length; ++f)
lib.addElementsToCache(txtInst[f], gFontsUpdateCacheList);
loadedGoogleCount++;
if(loadedGoogleCount == totalGoogleCount) {
lib.updateListCache(gFontsUpdateCacheList);
}
};
lib.tfontAvailable = function(family, totalTypekitCount) {
lib.properties.webfonts[family] = true;
var txtInst = lib.webFontTxtInst && lib.webFontTxtInst[family] || [];
for(var f = 0; f < txtInst.length; ++f)
lib.addElementsToCache(txtInst[f], tFontsUpdateCacheList);
loadedTypekitCount++;
if(loadedTypekitCount == totalTypekitCount) {
lib.updateListCache(tFontsUpdateCacheList);
}
};
// symbols:
// helper functions:
function mc_symbol_clone() {
var clone = this._cloneProps(new this.constructor(this.mode, this.startPosition, this.loop));
clone.gotoAndStop(this.currentFrame);
clone.paused = this.paused;
clone.framerate = this.framerate;
return clone;
}
function getMCSymbolPrototype(symbol, nominalBounds, frameBounds) {
var prototype = cjs.extend(symbol, cjs.MovieClip);
prototype.clone = mc_symbol_clone;
prototype.nominalBounds = nominalBounds;
prototype.frameBounds = frameBounds;
return prototype;
}
(lib.unterkiefer = function(mode,startPosition,loop) {
this.initialize(mode,startPosition,loop,{});
// Ebene 1
this.shape = new cjs.Shape();
this.shape.graphics.f().s("#000000").ss(1,1,1).p("AAYCVQgSAJgLABQgQgBgPgKQgWgOgWgbQgwgzgXg7Qg9ibDSAAQDdgJhGCiQgaA9g2AzQgaAagTAQg");
this.shape_1 = new cjs.Shape();
this.shape_1.graphics.f().s("#000000").ss(0.3,1,1).p("AB/gFQgXAzgtArQgWAXgRAMQgOAIgLABQgNgBgNgJQgSgLgTgXQgogrgUgxQgziCCyABQC7gIg7CHg");
this.shape_1.setTransform(0.3,-1);
this.shape_2 = new cjs.Shape();
this.shape_2.graphics.rf(["rgba(100,19,19,0.988)","rgba(163,33,33,0.988)","#000000"],[0,0.325,0.843],-0.4,11.2,0,-0.7,11.2,21.1).s().p("AgfB7QgSgLgTgXQgogrgUgxQgziCCyABQC7gIg7CHQgXAzgtArQgWAXgRAMQgOAIgLABQgNgBgNgJg");
this.shape_2.setTransform(0.3,-1);
this.shape_3 = new cjs.Shape();
this.shape_3.graphics.rf(["#1D9F92","#000000"],[0.494,1],0.8,4.3,0,0.8,4.3,17.9).s().p("AgkCUQgWgOgWgbQgwgzgXg7Qg9ibDSAAQDdgJhGCiQgaA9g2AzQgaAagTAQQgSAJgLABQgQgBgPgKgAh+gNQAUAxApArQASAXATALQANAIANACQAKgBAPgJQARgMAWgWQAtgrAWgzQA8iHi9AHIAAAAQixAAAzCCg");
this.timeline.addTween(cjs.Tween.get({}).to({state:[{t:this.shape_3},{t:this.shape_2},{t:this.shape_1},{t:this.shape}]}).wait(1));
}).prototype = getMCSymbolPrototype(lib.unterkiefer, new cjs.Rectangle(-17.5,-16.9,35.2,33.8), null);
(lib.pupillen = function(mode,startPosition,loop) {
this.initialize(mode,startPosition,loop,{});
// Ebene 1
this.shape = new cjs.Shape();
this.shape.graphics.f("#000000").s().p("AgGARQgMgFgHgIQgEgIADgGQADgHAJgDQALgBALAFQALAFAGAIQAFAIgDAHQgDAHgKACIgEAAQgIAAgIgEg");
this.shape.setTransform(-16.8,0);
this.timeline.addTween(cjs.Tween.get(this.shape).wait(1));
}).prototype = getMCSymbolPrototype(lib.pupillen, new cjs.Rectangle(-19.6,-2.1,5.6,4.3), null);
(lib.nasenloch = function(mode,startPosition,loop) {
this.initialize(mode,startPosition,loop,{});
// Ebene 2
this.shape = new cjs.Shape();
this.shape.graphics.f("#000000").s().p("AgGALQgCgEAAgHQAAgGACgFQADgEADAAQAEAAACAEQAEAFAAAGQAAAHgEAEQgCAFgEAAQgDAAgDgFg");
this.shape.setTransform(1.1,-0.5,1.451,1.451);
this.timeline.addTween(cjs.Tween.get(this.shape).wait(1));
// Ebene 1
this.shape_1 = new cjs.Shape();
this.shape_1.graphics.rf(["rgba(47,133,121,0.988)","#000000"],[0.694,1],0,0.4,0,0,0.4,2).s().p("AgOAUQgGgIAAgMQAAgLAGgIQAGgIAIAAQAJAAAGAIQAGAIAAALQAAAMgGAIQgGAIgJAAQgIAAgGgIg");
this.shape_1.setTransform(1,-1.3,1.451,1.451);
this.timeline.addTween(cjs.Tween.get(this.shape_1).wait(1));
}).prototype = p = new cjs.MovieClip();
p.nominalBounds = new cjs.Rectangle(-2.1,-5.3,6.2,8.2);
(lib.kugel = function(mode,startPosition,loop) {
this.initialize(mode,startPosition,loop,{});
// Ebene 1
this.shape = new cjs.Shape();
this.shape.graphics.f().s("#000000").ss(0.1,0,0,42).p("AAmAAQAAAPgMALQgLAMgPAAQgPAAgLgMQgLgLAAgPQAAgPALgLQALgLAPAAQAPAAALALQAMALAAAPg");
this.shape_1 = new cjs.Shape();
this.shape_1.graphics.rf(["#0CBFBF","#000000","#2F1038"],[0,0.784,0.914],-1,-1,0,-1,-1,3.9).s().p("AgaAaQgLgKAAgQQAAgOALgMQAMgLAOAAQAQAAAKALQAMAMAAAOQAAAQgMAKQgKAMgQAAQgOAAgMgMg");
this.timeline.addTween(cjs.Tween.get({}).to({state:[{t:this.shape_1},{t:this.shape}]}).wait(1));
}).prototype = getMCSymbolPrototype(lib.kugel, new cjs.Rectangle(-4.8,-4.8,9.6,9.6), null);
(lib.Ball = function(mode,startPosition,loop) {
this.initialize(mode,startPosition,loop,{});
// Ebene 2
this.shape = new cjs.Shape();
this.shape.graphics.f().s("#000000").ss(1,0,0,42).p("AD6AAQAABohJBJQhJBJhoAAQhnAAhJhJQhJhJAAhoQAAhnBJhJQBJhJBnAAQBoAABJBJQBJBJAABng");
this.shape_1 = new cjs.Shape();
this.shape_1.graphics.rf(["#00FFCD","#000000","#9500CB"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
this.shape_2 = new cjs.Shape();
this.shape_2.graphics.f().s("#000000").ss(1,0,0,42).p("Aj5AAQAAhnBJhJQBJhJBnAAQBoAABJBJQBJBJAABnQAABohJBJQhJBJhoAAQhnAAhJhJQhJhJAAhog");
this.shape_3 = new cjs.Shape();
this.shape_3.graphics.rf(["#24FBB0","#000000","#9500CB"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
this.shape_4 = new cjs.Shape();
this.shape_4.graphics.rf(["#49F692","#000000","#9500CB"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
this.shape_5 = new cjs.Shape();
this.shape_5.graphics.rf(["#6DF275","#000000","#9500CB"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
this.shape_6 = new cjs.Shape();
this.shape_6.graphics.rf(["#92ED58","#000000","#9500CB"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
this.shape_7 = new cjs.Shape();
this.shape_7.graphics.rf(["#B6E93B","#000000","#9500CB"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
this.shape_8 = new cjs.Shape();
this.shape_8.graphics.rf(["#DBE41D","#000000","#9500CB"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
this.shape_9 = new cjs.Shape();
this.shape_9.graphics.rf(["#FFE000","#000000","#9500CB"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
this.shape_10 = new cjs.Shape();
this.shape_10.graphics.rf(["#FFC004","#000000","#801DC1"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
this.shape_11 = new cjs.Shape();
this.shape_11.graphics.rf(["#FFA008","#000000","#6A3AB6"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
this.shape_12 = new cjs.Shape();
this.shape_12.graphics.rf(["#FF800C","#000000","#5557AC"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
this.shape_13 = new cjs.Shape();
this.shape_13.graphics.rf(["#FF6010","#000000","#4074A1"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
this.shape_14 = new cjs.Shape();
this.shape_14.graphics.rf(["#FF4014","#000000","#2B9197"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
this.shape_15 = new cjs.Shape();
this.shape_15.graphics.rf(["#FF2018","#000000","#15AE8C"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
this.shape_16 = new cjs.Shape();
this.shape_16.graphics.rf(["#FF001C","#000000","#00CB82"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
this.shape_17 = new cjs.Shape();
this.shape_17.graphics.rf(["#E8172C","#000000","#0EB989"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
this.shape_18 = new cjs.Shape();
this.shape_18.graphics.rf(["#D12E3C","#000000","#1BA68F"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
this.shape_19 = new cjs.Shape();
this.shape_19.graphics.rf(["#B9464C","#000000","#299496"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
this.shape_20 = new cjs.Shape();
this.shape_20.graphics.rf(["#A25D5C","#000000","#36819D"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
this.shape_21 = new cjs.Shape();
this.shape_21.graphics.rf(["#8B746C","#000000","#446FA3"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
this.shape_22 = new cjs.Shape();
this.shape_22.graphics.rf(["#748B7D","#000000","#515CAA"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
this.shape_23 = new cjs.Shape();
this.shape_23.graphics.rf(["#5DA28D","#000000","#5F4AB0"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
this.shape_24 = new cjs.Shape();
this.shape_24.graphics.rf(["#46B99D","#000000","#6C37B7"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
this.shape_25 = new cjs.Shape();
this.shape_25.graphics.rf(["#2ED1AD","#000000","#7A25BE"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
this.shape_26 = new cjs.Shape();
this.shape_26.graphics.rf(["#17E8BD","#000000","#8712C4"],[0,0.89,1],-2.2,-1.8,0,-2.2,-1.8,25.3).s().p("AivCwQhKhIAAhoQAAhnBKhIQBIhKBnAAQBoAABIBKQBKBIAABnQAABohKBIQhIBKhoAAQhnAAhIhKg");
this.timeline.addTween(cjs.Tween.get({}).to({state:[{t:this.shape_1},{t:this.shape}]}).to({state:[{t:this.shape_3},{t:this.shape_2}]},1).to({state:[{t:this.shape_4},{t:this.shape_2}]},1).to({state:[{t:this.shape_5},{t:this.shape_2}]},1).to({state:[{t:this.shape_6},{t:this.shape_2}]},1).to({state:[{t:this.shape_7},{t:this.shape_2}]},1).to({state:[{t:this.shape_8},{t:this.shape_2}]},1).to({state:[{t:this.shape_9},{t:this.shape}]},1).to({state:[{t:this.shape_10},{t:this.shape_2}]},1).to({state:[{t:this.shape_11},{t:this.shape_2}]},1).to({state:[{t:this.shape_12},{t:this.shape_2}]},1).to({state:[{t:this.shape_13},{t:this.shape_2}]},1).to({state:[{t:this.shape_14},{t:this.shape_2}]},1).to({state:[{t:this.shape_15},{t:this.shape_2}]},1).to({state:[{t:this.shape_16},{t:this.shape}]},1).to({state:[{t:this.shape_17},{t:this.shape_2}]},1).to({state:[{t:this.shape_18},{t:this.shape_2}]},1).to({state:[{t:this.shape_19},{t:this.shape_2}]},1).to({state:[{t:this.shape_20},{t:this.shape_2}]},1).to({state:[{t:this.shape_21},{t:this.shape_2}]},1).to({state:[{t:this.shape_22},{t:this.shape_2}]},1).to({state:[{t:this.shape_23},{t:this.shape_2}]},1).to({state:[{t:this.shape_24},{t:this.shape_2}]},1).to({state:[{t:this.shape_25},{t:this.shape_2}]},1).to({state:[{t:this.shape_26},{t:this.shape_2}]},1).to({state:[{t:this.shape_1},{t:this.shape}]},1).wait(1));
}).prototype = p = new cjs.MovieClip();
p.nominalBounds = new cjs.Rectangle(-26,-26,52,52);
(lib.auge = function(mode,startPosition,loop) {
this.initialize(mode,startPosition,loop,{});
// pupillen
this.instance = new lib.pupillen();
this.instance.parent = this;
this.instance.setTransform(17.1,0.7);
this.timeline.addTween(cjs.Tween.get(this.instance).wait(1));
// Ebene 3
this.shape = new cjs.Shape();
this.shape.graphics.f().s("#000000").ss(0.4,1,1).p("ABIAfQgHARgaADQgbADgdgMQgdgNgQgWQgQgUAHgQQAIgSAagDQAagDAdANQAeAMAQAVQAPAVgHARg");
this.shape.setTransform(-0.4,-1.7);
this.shape_1 = new cjs.Shape();
this.shape_1.graphics.rf(["#CBFFFA","#20262E"],[0.494,1],-0.2,0.7,0,-0.2,0.7,8.9).s().p("AgWA3QgigPgRgaQgSgaAKgXQAJgWAggGQAfgFAhAOQAhAPARAaQASAagJAWQgKAXggAFQgJACgJAAQgXAAgWgKgAgpgqQgaAEgIARQgHARAQAUQAQAVAdANQAdANAbgEQAagDAHgQQAHgSgPgVQgQgUgegNQgXgKgWAAIgKAAg");
this.shape_1.setTransform(0,-2.6);
this.timeline.addTween(cjs.Tween.get({}).to({state:[{t:this.shape_1},{t:this.shape}]}).wait(1));
// Ebene 1
this.shape_2 = new cjs.Shape();
this.shape_2.graphics.f().s("#000000").ss(0.4,1,1).p("ABTAjQgKAXggAFQgfAGgggOQgigPgRgaQgSgaAKgXQAJgWAggGQAfgFAhAOQAhAPARAaQASAagJAWg");
this.shape_2.setTransform(0,-2.6);
this.shape_3 = new cjs.Shape();
this.shape_3.graphics.rf(["#FFFFFF","#44344A"],[0.349,1],0,0.1,0,0,0.1,8.3).s().p("AgRAqQgdgNgQgWQgQgUAHgQQAIgSAagDQAagDAdANQAeAMAQAVQAPAVgHARQgHARgaADIgMABQgVAAgXgKg");
this.shape_3.setTransform(-0.4,-1.7);
this.timeline.addTween(cjs.Tween.get({}).to({state:[{t:this.shape_3},{t:this.shape_2}]}).wait(1));
}).prototype = getMCSymbolPrototype(lib.auge, new cjs.Rectangle(-9.6,-10.1,19.2,15.1), null);
(lib.SnakeHead = function(mode,startPosition,loop) {
this.initialize(mode,startPosition,loop,{});
// kopf
this.instance = new lib.auge();
this.instance.parent = this;
this.instance.setTransform(18.1,-12.4,1.251,1.251,0,0,180);
this.instance_1 = new lib.auge();
this.instance_1.parent = this;
this.instance_1.setTransform(-18,-12.4,1.251,1.251);
this.instance_2 = new lib.nasenloch("synched",0);
this.instance_2.parent = this;
this.instance_2.setTransform(-6.3,3.5,0.926,0.926,-30);
this.instance_3 = new lib.nasenloch("synched",0);
this.instance_3.parent = this;
this.instance_3.setTransform(5.2,2.5,0.926,0.926,30);
this.shape = new cjs.Shape();
this.shape.graphics.f().s("#000000").ss(1,0,0,42).p("AiJiqQAsgHAsgDQAsgDArACQAtADArAKQAvALAzgIQAJgCAKABQAgAEALAgQAPArgIAuQgFAigLAfQgEANgFAMQgTAtgoAcQglAZgrAOQgrAPgtAFQguAFgugHQgwgFgvgTQgtgQgkgiQgigggQgrQgBgDgBgDQgNgmgDgqQgCgrANgqQAJgfAhgDQAxAGAwAAQAEAAAEgBg");
this.shape.setTransform(0,-7.3);
this.shape_1 = new cjs.Shape();
this.shape_1.graphics.rf(["#0CBFBF","#000000","#2F1038"],[0,0.784,0.914],-0.7,-1.8,0,-0.7,-1.8,33.9).s().p("AgzCzQgwgFgvgTQgtgQgkgiQgigggQgrIgCgGQgNgmgDgqQgCgrANgqQAJgfAhgDQAxAGAwAAIAIgBQAsgHAsgDQAsgDArACQAtADArAKQAvALAzgIQAJgCAKABQAgAEALAgQAPArgIAuQgFAigLAfIgJAZQgTAtgoAcQglAZgrAOQgrAPgtAFQgTACgTAAQgbAAgbgEg");
this.shape_1.setTransform(0,-7.3);
this.timeline.addTween(cjs.Tween.get({}).to({state:[{t:this.shape_1},{t:this.shape},{t:this.instance_3},{t:this.instance_2},{t:this.instance_1},{t:this.instance}]}).wait(1));
// Ebene 5
this.instance_4 = new lib.kugel();
this.instance_4.parent = this;
this.instance_4.setTransform(59.9,-71.7,1,1,0,0,180);
this.instance_5 = new lib.kugel();
this.instance_5.parent = this;
this.instance_5.setTransform(-55.2,-71.7);
this.shape_2 = new cjs.Shape();
this.shape_2.graphics.f().s("#666666").ss(1,0,0,42).p("ABtEEQgbiZB4iRQB7iUDahFAhsEEQAbiZh4iRQh7iUjahF");
this.shape_2.setTransform(2.3,-44.9);
this.timeline.addTween(cjs.Tween.get({}).to({state:[{t:this.shape_2},{t:this.instance_5},{t:this.instance_4}]}).wait(1));
// maul
this.instance_6 = new lib.unterkiefer();
this.instance_6.parent = this;
this.instance_6.setTransform(0,9.9);
this.timeline.addTween(cjs.Tween.get(this.instance_6).wait(1));
}).prototype = getMCSymbolPrototype(lib.SnakeHead, new cjs.Rectangle(-59.1,-75.5,122.8,101.9), null);
// stage content:
(lib.snake = function(mode,startPosition,loop) {
this.initialize(mode,startPosition,loop,{});
// timeline functions:
this.frame_0 = function() {
var anzahl = 30;
var abstand = 15;
var ball = new Object();
ball[0] = new lib.SnakeHead();
ball[0].x = 500;
ball[0].y = 50;
this.addChild(ball[0]);
for(i = 1; i < anzahl; i++)
{
ball[i] = new lib.Ball();
ball[i].x = ball[i-1].x - abstand;
ball[i].y = 50;
ball[i].scaleX = 1 - i / anzahl;
ball[i].scaleY = 1 - i / anzahl;
ball[i].gotoAndPlay(i);
this.addChild(ball[i]);
}
//die zweite Schleife dient dazu die Stapelreihenfolge umzukehren
for(i = anzahl; i >= 0; i--)
{
this.addChild(ball[i]);
}
this.addEventListener("tick",mover.bind(this));
function mover()
{
var p = this.globalToLocal(this.stage.mouseX, this.stage.mouseY);
ball[0].x = ball[0].x + (p.x - ball[0].x) / 15;
ball[0].y = ball[0].y + (p.y - ball[0].y) / 15;
for (i = 1; i < anzahl; i++)
{
//horizontaler Abstand zum vorigen Element,
distX = ball[i - 1].x - ball[i].x;
//vertikaler Abstand zum vorigen Element
distY = ball[i - 1].y - ball[i].y;
//Abstand zum vorigen Element (Satz des Pythagoras a² * b² = c²)
dist = Math.sqrt(distX * distX + distY * distY);
//Verhältnis horizontaler Abstand zum wirklichen Abstand
cx = distX / dist;
cy = distY / dist;
//der gewünschte Abstand ist "abstand", der momentane Abstand ist "dist"
//Das Verhältnis horizontaler Abstand zu momenten Abstand ist "cx"
//Nun kann man anhand des Verhältnis cx den gewünschten X-Abstand ausrechnen
distX_new = cx * (abstand/(i*0.7)+5);
//auf gleiche Weise wird auch der gewünschte Y-Abstand errechnet
distY_new = cy * (abstand / ( i* 0.7)+5);
//Die neue Position wird gesetzt, der errechnete Abstand wird von der Position
//des vorigen Elementes abgezogen
ball[i].x = ball[i - 1].x - distX_new;
ball[i].y = ball[i - 1].y - distY_new;
}
}
}
// actions tween:
this.timeline.addTween(cjs.Tween.get(this).call(this.frame_0).wait(1));
}).prototype = p = new cjs.MovieClip();
p.nominalBounds = null;
// library properties:
lib.properties = {
id: 'A159DC6E08C1F34A8C922AA70F875570',
width: 800,
height: 800,
fps: 24,
color: "#000000",
opacity: 1.00,
webfonts: {},
manifest: [],
preloads: []
};
// bootstrap callback support:
(lib.Stage = function(canvas) {
createjs.Stage.call(this, canvas);
}).prototype = p = new createjs.Stage();
p.setAutoPlay = function(autoPlay) {
this.tickEnabled = autoPlay;
}
p.play = function() { this.tickEnabled = true; this.getChildAt(0).gotoAndPlay(this.getTimelinePosition()) }
p.stop = function(ms) { if(ms) this.seek(ms); this.tickEnabled = false; }
p.seek = function(ms) { this.tickEnabled = true; this.getChildAt(0).gotoAndStop(lib.properties.fps * ms / 1000); }
p.getDuration = function() { return this.getChildAt(0).totalFrames / lib.properties.fps * 1000; }
p.getTimelinePosition = function() { return this.getChildAt(0).currentFrame / lib.properties.fps * 1000; }
an.bootcompsLoaded = an.bootcompsLoaded || [];
if(!an.bootstrapListeners) {
an.bootstrapListeners=[];
}
an.bootstrapCallback=function(fnCallback) {
an.bootstrapListeners.push(fnCallback);
if(an.bootcompsLoaded.length > 0) {
for(var i=0; i<an.bootcompsLoaded.length; ++i) {
fnCallback(an.bootcompsLoaded[i]);
}
}
};
an.compositions = an.compositions || {};
an.compositions['A159DC6E08C1F34A8C922AA70F875570'] = {
getStage: function() { return exportRoot.getStage(); },
getLibrary: function() { return lib; },
getSpriteSheet: function() { return ss; },
getImages: function() { return img; }
};
an.compositionLoaded = function(id) {
an.bootcompsLoaded.push(id);
for(var j=0; j<an.bootstrapListeners.length; j++) {
an.bootstrapListeners[j](id);
}
}
an.getComposition = function(id) {
return an.compositions[id];
}
})(createjs = createjs||{}, AdobeAn = AdobeAn||{});
var createjs, AdobeAn;
</script>
<script>
var canvas, stage, exportRoot, anim_container, dom_overlay_container, fnStartAnimation;
function init() {
canvas = document.getElementById("canvas");
anim_container = document.getElementById("animation_container");
dom_overlay_container = document.getElementById("dom_overlay_container");
var comp=AdobeAn.getComposition("A159DC6E08C1F34A8C922AA70F875570");
var lib=comp.getLibrary();
handleComplete({},comp);
}
function handleComplete(evt,comp) {
//This function is always called, irrespective of the content. You can use the variable "stage" after it is created in token create_stage.
var lib=comp.getLibrary();
var ss=comp.getSpriteSheet();
var preloaderDiv = document.getElementById("_preload_div_");
preloaderDiv.style.display = 'none';
canvas.style.display = 'block';
exportRoot = new lib.snake();
stage = new lib.Stage(canvas);
stage.addChild(exportRoot);
fnStartAnimation = function() {
createjs.Ticker.setFPS(lib.properties.fps);
createjs.Ticker.addEventListener("tick", stage);
}
//Code to support hidpi screens and responsive scaling.
function makeResponsive(isResp, respDim, isScale, scaleType) {
var lastW, lastH, lastS=1;
window.addEventListener('resize', resizeCanvas);
resizeCanvas();
function resizeCanvas() {
var w = lib.properties.width, h = lib.properties.height;
var iw = window.innerWidth, ih=window.innerHeight;
var pRatio = window.devicePixelRatio || 1, xRatio=iw/w, yRatio=ih/h, sRatio=1;
if(isResp) {
if((respDim=='width'&&lastW==iw) || (respDim=='height'&&lastH==ih)) {
sRatio = lastS;
}
else if(!isScale) {
if(iw<w || ih<h)
sRatio = Math.min(xRatio, yRatio);
}
else if(scaleType==1) {
sRatio = Math.min(xRatio, yRatio);
}
else if(scaleType==2) {
sRatio = Math.max(xRatio, yRatio);
}
}
canvas.width = w*pRatio*sRatio;
canvas.height = h*pRatio*sRatio;
canvas.style.width = anim_container.style.width = dom_overlay_container.style.width = preloaderDiv.style.width = w*sRatio+'px';
canvas.style.height = anim_container.style.height = dom_overlay_container.style.height = preloaderDiv.style.height = h*sRatio+'px';
stage.scaleX = pRatio*sRatio;
stage.scaleY = pRatio*sRatio;
lastW = iw; lastH = ih; lastS = sRatio;
}
}
makeResponsive(true,'both',true,1);
AdobeAn.compositionLoaded(lib.properties.id);
fnStartAnimation();
}
</script>
<!-- write your code here -->
</head>
<body onload="init();" style="margin:0px;">
<div id="animation_container" style="background-color:rgba(0, 0, 0, 1.00); width:800px; height:800px">
<canvas id="canvas" width="800" height="800" style="position: absolute; display: none; background-color:rgba(0, 0, 0, 1.00);"></canvas>
<div id="dom_overlay_container" style="pointer-events:none; overflow:hidden; width:800px; height:800px; position: absolute; left: 0px; top: 0px; display: none;">
</div>
</div>
<div id='_preload_div_' style='display: inline-block; height:800px; width: 800px; vertical-align=middle;position:absolute;left:0px;top:0px;text-align: center;'> <span style='display: inline-block; height: 100%; vertical-align: middle;'></span> <img src=https://on-design.de/html5/snake/images/_preloader.gif style='vertical-align: middle; max-height: 100%'/></div>
</body>
</html>