Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
Angular-Pixijs-Game
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Richard Torenvliet
Angular-Pixijs-Game
Commits
164057e3
Commit
164057e3
authored
Jun 12, 2015
by
Richard Torenvliet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add loadbar
parent
d581cc59
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
54 additions
and
40 deletions
+54
-40
src/app/game/tapdance/tapdance-game.js
src/app/game/tapdance/tapdance-game.js
+54
-36
src/app/game/tapdance/tapdance-game.tpl.html
src/app/game/tapdance/tapdance-game.tpl.html
+0
-3
src/assets/jeans_bg_white.png
src/assets/jeans_bg_white.png
+0
-0
src/assets/loader.png
src/assets/loader.png
+0
-0
src/less/main.less
src/less/main.less
+0
-1
No files found.
src/app/game/tapdance/tapdance-game.js
View file @
164057e3
...
@@ -30,58 +30,76 @@ angular.module('Interactive.game.tapdance.game', [
...
@@ -30,58 +30,76 @@ angular.module('Interactive.game.tapdance.game', [
})
})
.
directive
(
'
pixi
'
,
function
(
$parse
,
$state
)
{
.
directive
(
'
pixi
'
,
function
(
$parse
,
$state
)
{
return
{
return
{
restrict
:
'
A
'
,
restrict
:
'
A
'
,
scope
:
true
,
scope
:
true
,
controller
:
function
(
$scope
,
$element
,
$attrs
,
$document
,
$window
)
{
controller
:
function
(
$scope
,
$element
,
$attrs
,
$document
,
$window
)
{
// init the first element
// init the first element
$element
=
$element
[
0
];
$element
=
$element
[
0
];
var
game_div
=
document
.
getElementsByClassName
(
'
game-background
'
)[
0
];
var
game_div
=
document
.
getElementsByClassName
(
'
game-background
'
)[
0
];
var
width
=
game_div
.
scrollWidth
;
var
width
=
game_div
.
scrollWidth
;
var
height
=
60
0
;
var
height
=
66
0
;
console
.
log
(
width
,
height
);
console
.
log
(
width
,
height
);
// TODO: set color from options
// TODO: set color from options
var
stage
=
new
PIXI
.
Stage
();
var
stage
=
new
PIXI
.
Stage
();
// create the root of the scene graph
// create the root of the scene graph
var
renderer
=
PIXI
.
autoDetectRenderer
(
width
,
height
,
var
renderer
=
PIXI
.
autoDetectRenderer
(
width
,
height
,
{
view
:
$element
,
{
view
:
$element
,
transparent
:
true
});
transparent
:
true
});
var
jeans
=
PIXI
.
Sprite
.
fromImage
(
'
/assets/jeans_plane.png
'
);
var
bg_white
=
PIXI
.
Sprite
.
fromImage
(
'
/assets/jeans_bg_white.png
'
);
var
bg
=
PIXI
.
Sprite
.
fromImage
(
'
/assets/jeans_cutout.png
'
);
var
jeans
=
PIXI
.
Sprite
.
fromImage
(
'
/assets/jeans_plane.png
'
);
var
water
=
PIXI
.
Sprite
.
fromImage
(
'
/assets/water.png
'
);
var
bg
=
PIXI
.
Sprite
.
fromImage
(
'
/assets/jeans_cutout.png
'
);
var
water
=
PIXI
.
Sprite
.
fromImage
(
'
/assets/water.png
'
);
var
loader
=
PIXI
.
Sprite
.
fromImage
(
'
/assets/loader.png
'
);
bg
.
width
=
renderer
.
width
;
bg_white
.
width
=
renderer
.
width
;
bg
.
height
=
renderer
.
height
;
bg_white
.
height
=
renderer
.
height
;
jeans
.
width
=
renderer
.
width
;
jeans
.
height
=
renderer
.
height
;
water
.
width
=
renderer
.
width
;
water
.
height
=
renderer
.
height
;
stage
.
addChild
(
jeans
);
bg
.
width
=
renderer
.
width
;
stage
.
addChild
(
water
);
bg
.
height
=
renderer
.
height
;
stage
.
addChild
(
bg
);
animate
();
jeans
.
width
=
renderer
.
width
;
jeans
.
height
=
renderer
.
height
;
function
animate
()
{
water
.
width
=
renderer
.
width
;
renderer
.
render
(
stage
);
water
.
height
=
renderer
.
height
;
requestAnimFrame
(
animate
);
if
(
$scope
.
game
)
{
loader
.
y
=
0
;
loader
.
x
=
0
;
loader
.
height
=
24
;
stage
.
addChild
(
bg_white
);
stage
.
addChild
(
jeans
);
stage
.
addChild
(
water
);
stage
.
addChild
(
bg
);
stage
.
addChild
(
bg_white
);
stage
.
addChild
(
loader
);
animate
();
function
animate
()
{
renderer
.
render
(
stage
);
requestAnimFrame
(
animate
);
if
(
$scope
.
game
)
{
water
.
position
.
y
+=
1
;
water
.
position
.
y
+=
1
;
if
(
water
.
position
.
y
>
500
)
{
loader
.
position
.
x
+=
0.5
;
if
(
water
.
position
.
y
>
520
)
{
$scope
.
$apply
(
function
()
{
$scope
.
$apply
(
function
()
{
$scope
.
game
=
false
;
$scope
.
game
=
false
;
$state
.
go
(
'
game-tapdance-result
'
);
$state
.
go
(
'
game-tapdance-result
'
);
});
});
}
}
}
}
}
}
}
}
};
};
})
})
...
...
src/app/game/tapdance/tapdance-game.tpl.html
View file @
164057e3
<div
class=
"game-background"
>
<div
class=
"game-background"
>
<img
ng-show=
'!game'
class=
"bg-image"
src=
"/assets/jeans_bg.jpg"
alt=
'bg'
/>
<img
ng-show=
'!game'
class=
"bg-image"
src=
"/assets/jeans_bg.jpg"
alt=
'bg'
/>
<div
ng-show=
'!game'
class=
"popup gold"
>
<div
ng-show=
'!game'
class=
"popup gold"
>
<h1
class=
"text-center"
>
TRYOUT
</h1>
<h1
class=
"text-center"
>
TRYOUT
</h1>
<p
class=
"text-center"
>
Before you start dancing
</p>
<p
class=
"text-center"
>
Before you start dancing
</p>
...
@@ -13,8 +12,6 @@
...
@@ -13,8 +12,6 @@
</div>
</div>
<div
ng-show=
'game'
class=
"game"
>
<div
ng-show=
'game'
class=
"game"
>
<img
class=
"bg-image"
src=
"/assets/jeans_bg_white.jpg"
alt=
'bg'
/>
<canvas
pixi=
"stage"
class=
"tapdance"
pixi-render=
"pixiRender"
<canvas
pixi=
"stage"
class=
"tapdance"
pixi-render=
"pixiRender"
pixi-transparent=
"true"
pixi-renderer=
"'webgl'"
></canvas>
pixi-transparent=
"true"
pixi-renderer=
"'webgl'"
></canvas>
</div>
</div>
...
...
src/assets/jeans_bg_white.png
0 → 100644
View file @
164057e3
17 KB
src/assets/loader.png
0 → 100644
View file @
164057e3
392 Bytes
src/less/main.less
View file @
164057e3
...
@@ -238,7 +238,6 @@ canvas {
...
@@ -238,7 +238,6 @@ canvas {
canvas.tapdance {
canvas.tapdance {
position: absolute;
position: absolute;
top: 20px;
left: 0px;
left: 0px;
z-index: 2;
z-index: 2;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment