/*
 *  main.js
 *  2015/09/08
 *  @auther minimo  
 *  This Program is MIT license.
 */

//phina.globalize();

//定数
//デバッグフラグ
DEBUG = false;
MUTEKI = false;
VIEW_COLLISION = false;

//スクリーンサイズ
SC_W = 320;
SC_H = 480;
SC_OFFSET_X = 0;
SC_OFFSET_Y = 0;

//レイヤー区分
LAYER_SYSTEM = 10;          //システム表示
LAYER_FOREGROUND = 9;       //フォアグラウンド
LAYER_EFFECT_UPPER = 8;     //エフェクト上位
LAYER_PLAYER = 8;           //プレイヤー
LAYER_OBJECT_UPPER = 6;     //オブジェクト上位
LAYER_BULLET = 5;           //弾    
LAYER_SHOT = 4;             //ショット
LAYER_OBJECT = 3;           //オブジェクト中間
LAYER_OBJECT_LOWER = 2;     //オブジェクト下位
LAYER_EFFECT_LOWER = 1;     //エフェクト下位
LAYER_BACKGROUND = 0;       //バックグラウンド

//敵タイプ定数
ENEMY_SMALL = 0;
ENEMY_MIDDLE = 1;
ENEMY_LARGE = 2;
ENEMY_MBOSS = 3;
ENEMY_BOSS = 4;
ENEMY_ITEM = 9;

//爆発タイプ定数
EXPLODE_SMALL = 0;
EXPLODE_MIDDLE = 1;
EXPLODE_LARGE = 2;
EXPLODE_GROUND = 3;
EXPLODE_MBOSS = 4;
EXPLODE_BOSS = 5;

var KEYBOARD_MOVE = {
      0: { x:  1.0, y:  0.0 },
     45: { x:  0.7, y: -0.7 },
     90: { x:  0.0, y: -1.0 },
    135: { x: -0.7, y: -0.7 },
    180: { x: -1.0, y:  0.0 },
    225: { x: -0.7, y:  0.7 },
    270: { x:  0.0, y:  1.0 },
    315: { x:  0.7, y:  0.7 },
};

//インスタンス
var app;

window.onload = function() {
    app = pbr.Application();
    app.run();
    app.enableStats();
};

@@ -1295,12 +1295,540 @@
 Stats();%0A%7D;%0A
+%0A//%E3%82%A8%E3%83%AC%E3%83%A1%E3%83%B3%E3%83%88%E5%90%8C%E5%A3%AB%E3%81%AE%E6%8E%A5%E8%A7%A6%E5%88%A4%E5%AE%9A%0Aphina.display.CanvasElement.prototype.isHitElement = function(elm) %7B%0A    if (this.boundingType == 'rect') %7B%0A        if (elm.boundingType == 'rect') %7B%0A            return phina.collision.testRectRect(this, elm);%0A        %7D else %7B%0A            return phina.collision.testRectCircle(this, elm);%0A        %7D%0A    %7D else %7B%0A        if (elm.boundingType == 'rect') %7B%0A            return phina.collision.testRectRect(this, elm);%0A        %7D else %7B%0A            return phina.collision.testCircleRect(this, elm);%0A        %7D%0A    %7D%0A%7D%0A%0A

update element collison