@@ -214,18 +214,14 @@ class SceneSP : public Scene
virtual void Render();
virtual void Exit();
float translateX;
float rotateAngle2;
float rotateAngle3;
float rotatedoor;
float scaleAll;
float scalekirby;
int gamestate;
Camera3 camera;

//Functions---------------------------------------
void initSkybox();
void initSupermarket();

void initNPC();

//Render
void RenderMesh(Mesh *mesh, bool enableLight);
void RenderText(Mesh* mesh, std::string text, Color color);
@@ -241,16 +237,7 @@ class SceneSP : public Scene
void RenderPictureOnScreen(Mesh* mesh, float sizeX , float sizeY , float x, float y);
void RenderTapWater();
void RenderFlush();


int Renderirr();
//update
void updateMainMenu();
void updateChooseMode();
void updateRoam();
void updateCheckOut();
void updateFun();


//collision
bool AABBCheck(const Obj &box1,const Obj &box2);
@@ -262,10 +249,20 @@ class SceneSP : public Scene
void updatecollision(double dt);
void updateobj();

//Interactions and their other variables
void SlidingDoor(double);
vector <Obj> OBJ ;
vector <Obj> Items ;
vector <Obj> Interactables ;

Obj box1 ;
Obj seewhere;


int ItemNo;

vector <CItem> ItemData;

//Interactions and their other variables
void SlidingDoor(double);
double DoorSlide;

void Jump (double);
@@ -281,35 +278,33 @@ class SceneSP : public Scene
bool PickUpItem;
bool interactmah;
bool DetectorsOn;
bool toiletDoor;
bool securityDoor;

float toiletDoorMove;
float securityDoorMove;

float DoorSlideL; // Variable to move left door
float DoorSlideR; // Variable to move right door
bool inSupermarket; // Variable to check whether player is in the supermarket

//Npc movement
float Passerby2Left;
float Passerby2Right;
float Passerby2Dist;

//NPC interactions, // Variable to check whether NPC is interacted with
bool CashierText;
bool SecurityText;
bool CustomerText;

double time; // timer
//Collision

vector <Obj> OBJ ;
vector <Obj> Items ;
vector <Obj> Interactables ;

Obj box1 ;
Obj seewhere;

//timer
double time;

int ItemNo;

vector <CItem> ItemData;

//Npcs

//npcs
//Collision


//NPC
CNpc Cashier;
CNpc Guard;
CNpc Customer;
@@ -57,11 +57,11 @@ void SceneSP::Jump (double dt)
void SceneSP::updateItemSlide(double dt, int a )
{
// to see which cashier table to render
if ( a == 11 )
if ( a == 13 )
{
translateItemX = 0 ;
}
else if ( a == 12 )
else if ( a == 14 )
{
translateItemX = 9 ;
}
@@ -0,0 +1,46 @@
#include "SceneSP.h"

bool PB2LForward = true;
bool PB2RForward = false;
float WalkingSpeed = 100.f;
void SceneSP::UpdateNPC(double dt)
{
//Passerby2
if ( PB2LForward == true )
{
Passerby2Left += (WalkingSpeed * dt);
if ( Passerby2Left > 45 )
{
PB2LForward = false;
}
}
else
{
Passerby2Left -= (WalkingSpeed * dt);
if ( Passerby2Left < -45 )
{
PB2LForward = true;
}
}
if ( PB2RForward == true )
{
Passerby2Right += (WalkingSpeed * dt);
if ( Passerby2Right > 45 )
{
PB2RForward = false;
}
}
else
{
Passerby2Right -= (WalkingSpeed * dt);
if ( Passerby2Right < -45 )
{
PB2RForward = true;
}
}
Passerby2Dist += (5 * dt);
if ( Passerby2Dist > 100 )
{
Passerby2Dist = 0;
}
}
@@ -137,6 +137,23 @@ void SceneSP::updateobj()

Interactables[0].set(Vector3(10 - DoorSlide * 2 + 0.75 ,20,-5.5),Vector3(0.5 - DoorSlide * 2 + 0.75,0,-7.5));
Interactables[1].set(Vector3(1 + DoorSlide * 2 + 0.75 ,20,-5.5),Vector3(-8 + DoorSlide * 2 + 0.75 ,0,-7.5));

if ( toiletDoor == false )
{
Interactables[11].set(Vector3(23,20,38.5),Vector3(17.8,0,36.8));
}
if ( toiletDoor == true )
{
Interactables[11].set(Vector3(18.6,20,41.3),Vector3(17,0,37.7));
}
if ( securityDoor == false )
{
Interactables[12].set(Vector3(-10.7,20,39.0),Vector3(-16.0,0,36.8));
}
if ( securityDoor == true )
{
Interactables[12].set(Vector3(-11.5,20,42.7),Vector3(-12.4,0,37.2));
}
}

Obj SceneSP::ItemTargetcollision() // returns the item that the target has collided with ( Obj format)