Commit 1578c084 authored by 18신대성's avatar 18신대성 Committed by 16이지혜

씬 분리 성공

parent a8aa3e7f
......@@ -4,6 +4,7 @@
<meta charset="utf-8"/>
<script src="/socket.io/socket.io.js"></script>
<script src="js/phaser.js"></script>
<script src="js/ScenesData.js"></script>
<script src="js/Background.js"></script>
<script src="js/Input.js"></script>
<script src="js/WordSpace.js"></script>
......
var gameScene = new Phaser.Class(
{
Extends: Phaser.Scene,
initialize:
function gameScene (config)
{
Phaser.Scene.call(this, config);
},
preload: function()
{
BackGround.loadImage(this);
WordSpace.loadImage(this);
Input.inputField.loadImage(this);
CSVParsing.loadText(this);
},
create: function()
{
BackGround.drawBrain(this);
Input.inputField.generate(this);
WordSpace.wordPhysicsGroup = this.physics.add.group();
WordSpace.wordCycle.resetCycle(this, 3000);
WordSpace.attackGauge.resetCycle(this);
CSVParsing.CSVParse(this);
},
update: function()
{
WordSpace.wordForcedGroup.forEach(function(element)
{
element.attract();
});
}
});
\ No newline at end of file
......@@ -9,43 +9,12 @@ var config = {
}
},
backgroundColor: Phaser.Display.Color.GetColor(0,0,0),
scene: {
preload: preload,
create: create,
update: update
}
scene: [ gameScene ]
};
var game = new Phaser.Game(config)
var playerNum = -1;
// load assets
function preload()
{
BackGround.loadImage(this);
WordSpace.loadImage(this);
Input.inputField.loadImage(this);
CSVParsing.loadText(this);
}
function create()
{
BackGround.drawBrain(this);
Input.inputField.generate(this);
WordSpace.wordPhysicsGroup = this.physics.add.group();
WordSpace.wordCycle.resetCycle(this, 3000);
WordSpace.attackGauge.resetCycle(this);
CSVParsing.CSVParse(this);
}
function update()
{
WordSpace.wordForcedGroup.forEach(function(element)
{
element.attract();
});
}
// client side
var socket = io.connect();
socket.emit('idRequest');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment