Page 438 - 완) I MDP 프로젝트 작품 보고서(전체과 1학년)1.6
P. 438
height: height
}); //위에서 지정한 이미지의 정보들과 KineticImage 라이브러리를 이용하여
background에서 생성되는 제어 가능한 이미지를 만든다.
self.game.layer.add(self.kineticImage);
self.kineticImage.moveToBottom();
self.game.layer.draw();
//이미지 제어를 위한 설정(layer생성)과 공의 위치조정
};
//image.onload는 이미지를 불러와서 화면에 표시하는 메소드다 이미지의 경로는 image.src에 이미
지정해줬으니 위치와 크기만 지정해준다.
}
Object.defineProperty(Ball.prototype, "KineticImage", {
get: function () {
return this.kineticImage;
},
enumerable: true,
configurable: true
}); //상속을 위한 Ball.KineticImage객체를 만들었다.
return Ball; //다른 문서에서 Ball을 호출할 경우 이 문서에서 설정된 공의 정보들이
반환된다.
})();
ShellGame.Ball = Ball;
})(ShellGame || (ShellGame = {}));
ShellGame - Cup.js (컵 생성 및 제어용 소스)
var ShellGame;
(function (ShellGame) {
var Cup = (function () {
function Cup(place, hasBall, imageUrl, game) {
this.constants = new ShellGame.Constants();
var position = new ShellGame.Position(0, 0);
//사용할 모듈을 변수에 저장
this.isSwapInProgress = false;
this.raisedUp = false;
this.selected = false;
switch (place) {
case 0 /* Left */:
- 431 -