diff options
author | Treeki <treeki@gmail.com> | 2012-12-02 02:33:34 +0100 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2012-12-02 02:33:34 +0100 |
commit | 15af665eac26f9a29b864617d571ef539a6c42b0 (patch) | |
tree | 51505a63f6160cde691b3b9df15303d8b98fa0a1 /src/bossSamurshai.cpp | |
parent | 25bb4867ecfde3ec489b891b182cc0fdd2711ad3 (diff) | |
download | kamek-15af665eac26f9a29b864617d571ef539a6c42b0.tar.gz kamek-15af665eac26f9a29b864617d571ef539a6c42b0.zip |
collisionMgr_c updated
Diffstat (limited to '')
-rw-r--r-- | src/bossSamurshai.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/bossSamurshai.cpp b/src/bossSamurshai.cpp index 24c8615..9ed5b9a 100644 --- a/src/bossSamurshai.cpp +++ b/src/bossSamurshai.cpp @@ -202,8 +202,8 @@ daSamurshai *daSamurshai::build() { HandleYSpeed(); doSpriteMovement(); - cmgr_returnValue = collMgr.CollidedWithTile(); - collMgr.execute(); + cmgr_returnValue = collMgr.isOnTopOfTile(); + collMgr.calculateBelowCollisionWithSmokeEffect(); if (isBouncing) { stuffRelatingToCollisions(0.1875f, 1.0f, 0.5f); @@ -211,7 +211,7 @@ daSamurshai *daSamurshai::build() { isBouncing = false; } - if (collMgr.CollidedWithTile()) { + if (collMgr.isOnTopOfTile()) { // Walking into a tile branch if (cmgr_returnValue == 0) @@ -223,23 +223,23 @@ daSamurshai *daSamurshai::build() { // Bouncing checks if (_34A & 4) { Vec v = (Vec){0.0f, 1.0f, 0.0f}; - collMgr.parent_speed_ptr = &v; + collMgr.pSpeed = &v; - if (collMgr.SomethingSemiImportant(collMgr.bitfield_for_checks)) + if (collMgr.calculateAboveCollision(collMgr.outputMaybe)) speed.y = 0.0f; - collMgr.parent_speed_ptr = &speed; + collMgr.pSpeed = &speed; } else { - if (collMgr.SomethingSemiImportant(collMgr.bitfield_for_checks)) + if (collMgr.calculateAboveCollision(collMgr.outputMaybe)) speed.y = 0.0f; } - collMgr.s_8006FA40(0); + collMgr.calculateAdjacentCollision(0); // Switch Direction - if (collMgr.bitfield_for_checks & (0x15 << direction)) { - if (collMgr.CollidedWithTile()) { + if (collMgr.outputMaybe & (0x15 << direction)) { + if (collMgr.isOnTopOfTile()) { isBouncing = true; } return true; @@ -316,16 +316,16 @@ int daSamurshai::onCreate() { _324 = 18.0f; // These structs tell stupid collider what to collide with - these are from koopa troopa - static const u8 one[16] = {0,0,0,1, 0,0,0xC0,0, 0,0,0x40,0, 0,0,0,0}; - static const u8 two[12] = {0,0,0,0, 0,0,0,0, 0,0,0xC0,0}; - static const u8 three[16] = {0,0,0,1, 0,0,0x60,0, 0,0,0x90,0, 0,0,0x60,0}; + static const lineSensor_s below(12<<12, 4<<12, 0<<12); + static const pointSensor_s above(0<<12, 12<<12); + static const lineSensor_s adjacent(6<<12, 9<<12, 6<<12); - collMgr.Init(this, one, two, three); - collMgr.execute(); + collMgr.init(this, &below, &above, &adjacent); + collMgr.calculateBelowCollisionWithSmokeEffect(); - cmgr_returnValue = collMgr.CollidedWithTile(); + cmgr_returnValue = collMgr.isOnTopOfTile(); - if (collMgr.CollidedWithTile()) + if (collMgr.isOnTopOfTile()) isBouncing = false; else isBouncing = true; |