-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
55 additions
and
2 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -90,11 +90,19 @@ class ItemManager extends Group | |
for item_elem in @item_obj | ||
for item in item_elem | ||
console.log t | ||
if t.intersect(item) and user_area.intersect(item) | ||
if t.intersect(item)# and user_area.intersect(item) | ||
console.log 'deleted' | ||
@deleteSushi item_elem | ||
@server.room_socket.emit 'get_sushi' , { sushi_order_id : item_elem[1].object_id} | ||
@sushi_list.add(item_elem[1].object_id) | ||
### | ||
# TODO : サーバ側の判定がないのでモック代わりにランダムで判定させる | ||
### | ||
result = Math.floor Math.random() * 2 | ||
if result is 1 | ||
@addChild new GetTrueImageObject @ | ||
else | ||
@addChild new GetFalseImageObject @ | ||
createSushi : (elem) -> | ||
### | ||
# 寿司生成メソッド | ||
|
@@ -140,7 +148,7 @@ class ItemObject extends KawazSprite | |
@invincibleTimer.setComplete -> | ||
@stop() | ||
update : (e) -> | ||
@x -= 8 | ||
@x -= 28 | ||
|
||
class PlateObject extends ItemObject | ||
### | ||
|
@@ -152,6 +160,49 @@ class PlateObject extends ItemObject | |
constructor: (price,x=0,y=0) -> | ||
super "plate_#{price}", x, y | ||
|
||
class AbstractJudgeObject extends KawazSprite | ||
### | ||
# 寿司取得時の判定時の画像の基底クラス | ||
# Author : miio mitani <[email protected]> | ||
# Package ; Osushi | ||
# Licence : GNU Lesser General Public License v3 (http://www.gnu.org/licenses/) | ||
### | ||
constructor : (mediator, name) -> | ||
### | ||
# TODO : 画面サイズから算出させたほうがいいと思うのです | ||
### | ||
super 300,300, 200, 200 | ||
@setImage "#{name}.png" | ||
@timer = new Timer 3 | ||
@mediator = mediator | ||
#¥ @timer.play | ||
@timer.setComplete -> | ||
console.log 'timer_end_get_sushi' | ||
@mediator.removeChild @ | ||
@timer.play() | ||
update : (e) -> | ||
@timer.tick() | ||
|
||
class GetTrueImageObject extends AbstractJudgeObject | ||
### | ||
# 寿司取得時に取得できたときの画像オブジェクトクラス | ||
# Author : miio mitani <[email protected]> | ||
# Package : Osushi | ||
# Licence : GNU Lesser General Public License v3 (http://www.gnu.org/licenses/) | ||
### | ||
constructor : (mediator) -> | ||
super mediator, "get_true" | ||
|
||
class GetFalseImageObject extends AbstractJudgeObject | ||
### | ||
# 寿司取得時に取得できなかったときの画像オブジェクトクラス | ||
# Author : miio mitani <[email protected]> | ||
# Package : Osushi | ||
# License : GNU Lesser General Public License v3 (http://www.gnu.org/licenses/) | ||
### | ||
constructor : (mediator) -> | ||
super mediator, "get_false" | ||
|
||
class SushiObject extends ItemObject | ||
### | ||
# 寿司オブジェクトクラス # | ||
|
79b9ca9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
そういえばまだ画像消えないな。。。