Merge pull request #89 from westonCoder/r-for-orange-portal

Slight Controls Change
This commit is contained in:
lambertjamesd 2023-04-01 21:43:31 -06:00 committed by GitHub
commit acf0210a61
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -255,14 +255,21 @@ void sceneCheckPortals(struct Scene* scene) {
quatMultVector(&scene->player.lookTransform.rotation, &raycastRay.dir, &raycastRay.dir);
quatMultVector(&scene->player.lookTransform.rotation, &gUp, &playerUp);
if (controllerGetButtonDown(0, Z_TRIG) && (scene->player.flags & PlayerHasSecondPortalGun) && !playerIsGrabbing(&scene->player)) {
int bluePortalFlags;
if (scene->player.flags & PlayerHasSecondPortalGun){
bluePortalFlags = (L_TRIG);
}else{
bluePortalFlags = (L_TRIG | Z_TRIG | R_TRIG);
}
if (controllerGetButtonDown(0, Z_TRIG | R_TRIG) && (scene->player.flags & PlayerHasSecondPortalGun) && !playerIsGrabbing(&scene->player)) {
sceneFirePortal(scene, &raycastRay, &playerUp, 0, scene->player.body.currentRoom, 1, 0);
scene->player.flags |= PlayerJustShotPortalGun;
scene->last_portal_indx_shot=0;
soundPlayerPlay(soundsPortalgunShoot[0], 1.0f, 1.0f, NULL, NULL);
}
if (controllerGetButtonDown(0, R_TRIG | L_TRIG) && (scene->player.flags & PlayerHasFirstPortalGun) && !playerIsGrabbing(&scene->player)) {
if (controllerGetButtonDown(0, bluePortalFlags) && (scene->player.flags & PlayerHasFirstPortalGun) && !playerIsGrabbing(&scene->player)) {
sceneFirePortal(scene, &raycastRay, &playerUp, 1, scene->player.body.currentRoom, 1, 0);
scene->player.flags |= PlayerJustShotPortalGun;
scene->last_portal_indx_shot=1;