Beispiel #1
0
void TestMaze()
{
	int n = 10;
	int** ppMaze = CreateMaze(n);
	Pos entry = InitMaze(ppMaze, n);
	PrintMaze(ppMaze, n);

	Stack<Pos> path;
	Maze(ppMaze, n, entry, path);
	PrintMaze(ppMaze, n);

	cout<<"Path:";
	while (!path.Empty())
	{
		const Pos& pos = path.Top();
		cout<<"("<<pos.row<<","<<pos.col<<")"<<"<-";
		path.Pop();
	}

	cout<<"Entry"<<endl;
}
Beispiel #2
0
float fn[10000]; //wektory normalne
float ftv[10000];//wsp. texturowania;
int fvc; //liczba wierzcho³ków latarki;
glm::mat4 MatO = glm::mat4(1.0);

//Textury
GLuint bufTexCoords;
GLuint tex0;
GLuint tex1;
GLuint tex2;

//Labirynt 
int maze_size = 8; 
int cur_layer = 0;
int layers = 5;
Maze M = Maze(maze_size, maze_size,layers);

//Zmienne pomocnicze
bool fly = false;
int p_i = 1, p_j = 1;

float angleLR = 0;
float angleUD = 0;


//Procedura rysuj¹ca jakiœ obiekt. Ustawia odpowiednie parametry dla vertex shadera i rysuje.
void drawObject() {
	//W³¹czenie programu cieniuj¹cego, który ma zostaæ u¿yty do rysowania
	//W tym programie wystarczy³oby wywo³aæ to raz, w setupShaders, ale chodzi o pokazanie, 
	//¿e mozna zmieniaæ program cieniuj¹cy podczas rysowania jednej sceny
	shaderProgram->use();
Beispiel #3
0
            void UpdateAI(const uint32 diff)
            { 
                // Falled to water in out of platform = die
                CheckPlayersInWater();

                if (!UpdateVictim())
                    return;

                events.Update(diff);

                switch (events.ExecuteEvent())
                {
                    case EVENT_HARD_STARE:
                        if (me->getVictim())
                        {
                            DoPlaySoundToSet(me, 35334); // wound
                            DoCast(me->getVictim(),SPELL_HARD_STARE);
                        }
                        events.ScheduleEvent(EVENT_HARD_STARE, 13000);
                        break;
                    case EVENT_GAZE:
                        {
                            Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 2.0f, true);
                            if (!target)
                                if (!me->HasUnitState(UNIT_STATE_CASTING))
                                    DoCast(SPELL_GAZE);
                            events.ScheduleEvent(EVENT_GAZE, 2000);
                            break;
                        }
                    case EVENT_BERSERK:
                        events.CancelEventGroup(0); // clear all events
                        me->AI()->Talk(SAY_BERSERK);
                        DoCast(SPELL_BERSERK_KILLALL);
                        break;
                    // Spectrum phase start
                    case EVENT_LIGHT_SPECTRUM_SAY_SUMMON:
                        FogKilled = 0;
                        me->AI()->Talk(SAY_SUMMON_SPECTRUM);
                        SummonSomeCreatures(RED_FOG, 3, 10.0f); // 3 red fog
                        SummonSomeCreatures(BLUE_FOG, 1, 10.0f); // 1 blue fog
                        events.ScheduleEvent(EVENT_LIGHT_SPECTRUM, 3000);
                        break;
                    case EVENT_LIGHT_SPECTRUM:
                        me->AI()->Talk(SAY_SPECTRUM_INF);
                        SummonBeamsEye();
                        break;
                    // Spectrum phase end

                    // Disintegration Beam phase start
                    case EVENT_MAZE_TIME:
                        Maze(true);
                        events.ScheduleEvent(EVENT_MAZE_ORIENTATION, 5000);
                        events.ScheduleEvent(EVENT_MAZE_END, 47000);
                        events.ScheduleEvent(EVENT_MIND_DAGGERS, 6000);
                        SendMazeToEyes(true);
                        break;
                    case EVENT_MAZE_ORIENTATION:
                        UpdateOrientation();
                        TryKillPlayerInFront();
                        events.ScheduleEvent(EVENT_MAZE_ORIENTATION, 200);
                        break;
                    case EVENT_MAZE_END:
                        Maze(false);
                        SendMazeToEyes(false);
                        events.ScheduleEvent(EVENT_LIGHT_SPECTRUM_SAY_SUMMON, 40000);
                        break;
                    case EVENT_MIND_DAGGERS:
                        DoCast(SPELL_MIND_DAGGERS);
                        events.ScheduleEvent(EVENT_MIND_DAGGERS, 6000);
                        break;
                    // Disintegration Beam phase end
                    default:
                        break;
                }

                if (!me->HasUnitState(UNIT_STATE_CASTING))
                    DoMeleeAttackIfReady();
            }