Commit 26551fff authored by 18신대성's avatar 18신대성 Committed by 16이지혜

stackalert외 다른 placeholder들 게임에 적용함

parent 41b11841
......@@ -8,21 +8,11 @@ BackGround.loadImage = function(scene)
{
if (!this.isImageLoaded)
{
scene.load.image('brainGround0', 'assets/platform.png'); // horizontal
scene.load.image('brainGround1', 'assets/platform2.png'); // vertical
scene.load.image('brainGround0', 'assets/placeholder/playback.png');
}
}
BackGround.drawBrain = function(scene)
{
brains = scene.physics.add.staticGroup();
brains.create(400, 500, 'brainGround0').setScale(1.5).setDepth(1).refreshBody();
brains.create(400, 100, 'brainGround0').setScale(1.5).setDepth(1).refreshBody();
brains.create(100, 300, 'brainGround1').setScale(0.5).setDepth(1).refreshBody();
brains.create(700, 300, 'brainGround1').setScale(0.5).setDepth(1).refreshBody();
brains.immovable = true;
this.brainGroup = brains;
brains = scene.add.sprite(640, 360, 'brainGround0').setDisplaySize(1282, 722).setDepth(1);
}
\ No newline at end of file
......@@ -273,8 +273,8 @@ Input.inputField =
{
generate: function(scene)
{
this.background = scene.add.sprite(400, 500, 'inputFieldBackground').setScale(0.2).setDepth(10);
this.text = scene.add.text(400, 500, "안녕하세요", {font: '15pt 궁서'}).setOrigin(0.5, 0.5).setColor('#000000').setDepth(10);
this.background = scene.add.sprite(640, 550, 'inputfield').setDepth(10);
this.text = scene.add.text(640, 550, "안녕하세요", {font: '25pt 궁서'}).setOrigin(0.5, 0.5).setColor('#000000').setDepth(10);
scene.input.keyboard.on('keyup', function() {Input.pressCount--; Input.justPressed = ''})
scene.input.keyboard.on('keydown-SHIFT', function() {Input.isShifted = true});
......@@ -327,7 +327,7 @@ Input.inputField =
},
loadImage: function(scene)
{
scene.load.image('inputFieldBackground', 'assets/inputFieldBackground.png');
scene.load.image('inputfield', 'assets/placeholder/inputfield.png');
}
}
......
......@@ -22,10 +22,10 @@ class WordObject
instantiate(scene)
{
var random = WordSpace.spawnPoint[Math.floor(Math.random() * (WordSpace.spawnPoint.length))];
this.physicsObj = scene.physics.add.sprite(random.x, random.y, 'wordBackground').setScale(0.3);
var random = WordSpace.getSpawnPoint();
this.physicsObj = scene.physics.add.sprite(random.x, random.y, 'wordBgr' + this.wordGrade + '_' + Math.min(Math.max(2, this.wordText.length), 6));
this.physicsObj.body.bounce.set(0.5);
this.wordObj = scene.add.text(random.x, random.y, this.wordText, {fontFamily: '"궁서", 궁서체, serif'}).setColor('#000000').setOrigin(0.5,0.5);
this.wordObj = scene.add.text(random.x, random.y, this.wordText, {fontSize: '18pt', fontFamily: '"궁서", 궁서체, serif'}).setColor('#000000').setOrigin(0.5,0.5);
WordSpace.totalWeight += this.wordWeight;
WordSpace.setGameOverTimer();
console.log("Total weight : " + WordSpace.totalWeight);
......
......@@ -15,18 +15,16 @@ WordSpace.wordGroup = [];
WordSpace.wordForcedGroup = [];
WordSpace.wordPhysicsGroup = null;
WordSpace.gravityPoint = {x: 400, y: 300};
WordSpace.spawnPoint =
[
{x: 100, y: 100},
{x: 100, y: 300},
{x: 100, y: 500},
{x: 400, y: 100},
{x: 400, y: 500},
{x: 700, y: 100},
{x: 700, y: 300},
{x: 700, y: 500},
]
WordSpace.gravityPoint = {x: 640, y: 300};
WordSpace.getSpawnPoint = function()
{
let xLen = 600;
let yLen = 300;
const angle = Math.random() * Math.PI * 2;
let _x = xLen * Math.cos(angle) + this.gravityPoint.x;
let _y = yLen * Math.sin(angle) + this.gravityPoint.y;
return {x:_x, y:_y};
}
WordSpace.attackGauge =
{
......@@ -94,7 +92,13 @@ WordSpace.loadImage = function(scene)
{
if (!this.isImageLoaded)
{
scene.load.image('wordBackground', 'assets/wordBackground.png');
for (let i = 0; i < 4; i++)
{
for (let j = 2; j < 7; j++)
{
scene.load.image(('wordBgr' + i + '_' + j), ('assets/placeholder/'+i + '_' + j + '.png'));
}
}
}
WordSpace.gameSceneForTest = scene; // for test
}
......@@ -111,7 +115,6 @@ WordSpace.generateWord = function(scene, wordText)
object1.topObj.wordSpeed = 0.1;
object1.topObj.attract();
});
scene.physics.add.collider(word.physicsObj, BackGround.brainGroup);
WordSpace.wordPhysicsGroup.add(word.physicsObj);
}
......
var config = {
type: Phaser.AUTO,
width: 800,
height: 600,
width: 1280,
height: 720,
physics: {
default: 'arcade',
arcade: {
......
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