mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 02:03:36 +02:00
convert flappy avatars
This commit is contained in:
parent
cf2d82d320
commit
a9c95d8e7c
2 changed files with 14 additions and 14 deletions
|
@ -37,7 +37,7 @@
|
||||||
var yVelocity = 0.0;
|
var yVelocity = 0.0;
|
||||||
var yAcceleration = -G;
|
var yAcceleration = -G;
|
||||||
|
|
||||||
var airSwipeSound = SoundCache.getSound("https://s3-us-west-1.amazonaws.com/hifi-content/clement/production/Air Swipe 05.wav");
|
var airSwipeSound = SoundCache.getSound("http://hifi-production.s3.amazonaws.com/DomainContent/Toybox/flappyAvatars/Air%20Swipe%2005.wav");
|
||||||
var injector = null;
|
var injector = null;
|
||||||
|
|
||||||
this.position = function() {
|
this.position = function() {
|
||||||
|
@ -51,7 +51,7 @@
|
||||||
type: "Model",
|
type: "Model",
|
||||||
modelURL: MyAvatar.skeletonModelURL,
|
modelURL: MyAvatar.skeletonModelURL,
|
||||||
animation: {
|
animation: {
|
||||||
url: "http://hifi-content.s3.amazonaws.com/ozan/dev/anim/standard_anims_160127/fly.fbx",
|
url: "http://hifi-production.s3.amazonaws.com/DomainContent/Toybox/flappyAvatars/fly.fbx",
|
||||||
running: true,
|
running: true,
|
||||||
fps: 30,
|
fps: 30,
|
||||||
firstFrame: 1.0,
|
firstFrame: 1.0,
|
||||||
|
@ -76,7 +76,7 @@
|
||||||
animation: {running: false}
|
animation: {running: false}
|
||||||
});
|
});
|
||||||
|
|
||||||
airSwipeSound = SoundCache.getSound("https://s3-us-west-1.amazonaws.com/hifi-content/clement/production/8bit Jump 03.wav");
|
airSwipeSound = SoundCache.getSound("http://hifi-production.s3.amazonaws.com/DomainContent/Toybox/flappyAvatars/8bit%20Jump%2003.wav");
|
||||||
injector = null;
|
injector = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -132,7 +132,7 @@
|
||||||
|
|
||||||
var id = entityManager.add({
|
var id = entityManager.add({
|
||||||
type: "Model",
|
type: "Model",
|
||||||
modelURL: "https://s3-us-west-1.amazonaws.com/hifi-content/clement/production/coin.fbx",
|
modelURL: "http://hifi-production.s3.amazonaws.com/DomainContent/Toybox/flappyAvatars/coin.fbx",
|
||||||
angularVelocity: { x: 0, y: 20, z: 0 },
|
angularVelocity: { x: 0, y: 20, z: 0 },
|
||||||
position: to3DPosition(this.position()),
|
position: to3DPosition(this.position()),
|
||||||
dimensions:dimensions
|
dimensions:dimensions
|
||||||
|
@ -172,14 +172,14 @@
|
||||||
|
|
||||||
var idUp = entityManager.add({
|
var idUp = entityManager.add({
|
||||||
type: "Model",
|
type: "Model",
|
||||||
modelURL: "https://s3-us-west-1.amazonaws.com/hifi-content/clement/production/greenPipe.fbx",
|
modelURL: "http://hifi-production.s3.amazonaws.com/DomainContent/Toybox/flappyAvatars/greenPipe.fbx",
|
||||||
rotation: Quat.fromPitchYawRollDegrees(180, 0, 0),
|
rotation: Quat.fromPitchYawRollDegrees(180, 0, 0),
|
||||||
position: to3DPosition({ x: xPosition, y: upYPosition }),
|
position: to3DPosition({ x: xPosition, y: upYPosition }),
|
||||||
dimensions: { x: width, y: upHeight, z: width }
|
dimensions: { x: width, y: upHeight, z: width }
|
||||||
});
|
});
|
||||||
var idDown = entityManager.add({
|
var idDown = entityManager.add({
|
||||||
type: "Model",
|
type: "Model",
|
||||||
modelURL: "https://s3-us-west-1.amazonaws.com/hifi-content/clement/production/greenPipe.fbx",
|
modelURL: "http://hifi-production.s3.amazonaws.com/DomainContent/Toybox/flappyAvatars/greenPipe.fbx",
|
||||||
position: to3DPosition({ x: xPosition, y: height / 2.0 }),
|
position: to3DPosition({ x: xPosition, y: height / 2.0 }),
|
||||||
dimensions: { x: width, y: height, z: width }
|
dimensions: { x: width, y: height, z: width }
|
||||||
});
|
});
|
||||||
|
@ -217,7 +217,7 @@
|
||||||
var pipes = new Array();
|
var pipes = new Array();
|
||||||
var coins = new Array();
|
var coins = new Array();
|
||||||
|
|
||||||
var coinsSound = SoundCache.getSound("https://s3-us-west-1.amazonaws.com/hifi-content/clement/production/Coin.wav");
|
var coinsSound = SoundCache.getSound("http://hifi-production.s3.amazonaws.com/DomainContent/Toybox/flappyAvatars/Coin.wav");
|
||||||
var injector = null;
|
var injector = null;
|
||||||
|
|
||||||
this.update = function(deltaTime, gameTime, startedPlaying) {
|
this.update = function(deltaTime, gameTime, startedPlaying) {
|
||||||
|
@ -325,7 +325,7 @@
|
||||||
var numberDimensions = { x: 0.0660, y: 0.1050, z: 0.0048 };
|
var numberDimensions = { x: 0.0660, y: 0.1050, z: 0.0048 };
|
||||||
|
|
||||||
function numberUrl(number) {
|
function numberUrl(number) {
|
||||||
return "https://s3-us-west-1.amazonaws.com/hifi-content/clement/production/" + number + ".fbx"
|
return "http://hifi-production.s3.amazonaws.com/DomainContent/Toybox/flappyAvatars/" + number + ".fbx"
|
||||||
}
|
}
|
||||||
function digitPosition(digit) {
|
function digitPosition(digit) {
|
||||||
return Vec3.multiplyQbyV(space.orientation, { x: 0.3778 + digit * (numberDimensions.x + 0.01), y: 0.0, z: 0.0 });
|
return Vec3.multiplyQbyV(space.orientation, { x: 0.3778 + digit * (numberDimensions.x + 0.01), y: 0.0, z: 0.0 });
|
||||||
|
@ -341,7 +341,7 @@
|
||||||
|
|
||||||
var bestId = entityManager.add({
|
var bestId = entityManager.add({
|
||||||
type: "Model",
|
type: "Model",
|
||||||
modelURL: "https://s3-us-west-1.amazonaws.com/hifi-content/clement/production/best.fbx",
|
modelURL: "http://hifi-production.s3.amazonaws.com/DomainContent/Toybox/flappyAvatars/best.fbx",
|
||||||
position: topLeft,
|
position: topLeft,
|
||||||
rotation: Quat.multiply(space.orientation, Quat.fromPitchYawRollDegrees(90, 0, 0)),
|
rotation: Quat.multiply(space.orientation, Quat.fromPitchYawRollDegrees(90, 0, 0)),
|
||||||
dimensions: { x: 0.2781, y: 0.0063, z: 0.1037 }
|
dimensions: { x: 0.2781, y: 0.0063, z: 0.1037 }
|
||||||
|
@ -359,7 +359,7 @@
|
||||||
|
|
||||||
var scoreId = entityManager.add({
|
var scoreId = entityManager.add({
|
||||||
type: "Model",
|
type: "Model",
|
||||||
modelURL: "https://s3-us-west-1.amazonaws.com/hifi-content/clement/production/score.fbx",
|
modelURL: "http://hifi-production.s3.amazonaws.com/DomainContent/Toybox/flappyAvatars/score.fbx",
|
||||||
position: bottomLeft,
|
position: bottomLeft,
|
||||||
rotation: Quat.multiply(space.orientation, Quat.fromPitchYawRollDegrees(90, 0, 0)),
|
rotation: Quat.multiply(space.orientation, Quat.fromPitchYawRollDegrees(90, 0, 0)),
|
||||||
dimensions: { x: 0.3678, y: 0.0063, z: 0.1037 }
|
dimensions: { x: 0.3678, y: 0.0063, z: 0.1037 }
|
||||||
|
@ -453,7 +453,7 @@
|
||||||
var pipes = null;
|
var pipes = null;
|
||||||
var score = null;
|
var score = null;
|
||||||
|
|
||||||
var gameOverSound = SoundCache.getSound("https://s3-us-west-1.amazonaws.com/hifi-content/clement/production/Game Over.wav");
|
var gameOverSound = SoundCache.getSound("http://hifi-production.s3.amazonaws.com/DomainContent/Toybox/flappyAvatars/Game%20Over.wav");
|
||||||
var injector = null;
|
var injector = null;
|
||||||
|
|
||||||
var directions = ["UP", "DOWN", "LEFT", "RIGHT"];
|
var directions = ["UP", "DOWN", "LEFT", "RIGHT"];
|
||||||
|
@ -466,7 +466,7 @@
|
||||||
current = 0;
|
current = 0;
|
||||||
}
|
}
|
||||||
if (current === sequence.length) {
|
if (current === sequence.length) {
|
||||||
avatar.changeModel("https://s3-us-west-1.amazonaws.com/hifi-content/clement/production/mario.fbx");
|
avatar.changeModel("http://hifi-production.s3.amazonaws.com/DomainContent/Toybox/flappyAvatars/mario.fbx");
|
||||||
current = 0;
|
current = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
},
|
},
|
||||||
"dynamic": 1,
|
"dynamic": 1,
|
||||||
"id": "{ee5b25e6-aca2-4dc7-9462-51537d89c126}",
|
"id": "{ee5b25e6-aca2-4dc7-9462-51537d89c126}",
|
||||||
"modelURL": "https://s3-us-west-1.amazonaws.com/hifi-content/clement/production/cube.fbx",
|
"modelURL": "http://hifi-production.s3.amazonaws.com/DomainContent/Toybox/flappyAvatars/cube.fbx",
|
||||||
"queryAACube": {
|
"queryAACube": {
|
||||||
"scale": 0.5974045991897583,
|
"scale": 0.5974045991897583,
|
||||||
"x": -5.1575918197631836,
|
"x": -5.1575918197631836,
|
||||||
|
@ -23,7 +23,7 @@
|
||||||
"y": -0.13279926776885986,
|
"y": -0.13279926776885986,
|
||||||
"z": 0.34688329696655273
|
"z": 0.34688329696655273
|
||||||
},
|
},
|
||||||
"script": "https://raw.githubusercontent.com/Atlante45/hifi/feat/hackaton/examples/toybox/flappyAvatars/flappyAvatars.js",
|
"script": "http://hifi-production.s3.amazonaws.com/DomainContent/Toybox/flappyAvatars/flappyAvatars.js",
|
||||||
"scriptTimestamp": 1457031937425,
|
"scriptTimestamp": 1457031937425,
|
||||||
"shapeType": "box",
|
"shapeType": "box",
|
||||||
"type": "Model",
|
"type": "Model",
|
||||||
|
|
Loading…
Reference in a new issue