• Nenhum resultado encontrado

Capítulo 6 Conclusão

A.10 Pong.h

int main (int argc, char **argv)

{ GameManager *game = new GameManager();

game->run();

game->~GameManager();

return 0;

}

#endif // PONG_H

A.11 Pong.cpp

#include "Pong.h"

#include "Sprite.h"

#include "Sound.h"

#include "Text.h"

#include <cstdlib>

#include <time.h>

#include <string.h>

Pong * Pong::instance = NULL;

Pong * Pong::getInstance() { if (!instance)

{ instance = new Pong("imagens/bolapong.png",100,100,"music/sfx01.wav");

}return instance;

}Pong::Pong(char nome[50],int px,int py,char fileSound[50]) { x = px;

y = py;

SDL_Rect ret;

ret.x = x;

ret.y = y;

ret.w = 1;

ret.h = 1;

vx = 3;

vy = 3;

som = new Sound(fileSound);

s = new Sprite(nome,px,py,ret);

}

//e' chamado em caso de colisoes

void Pong::colisao(float vx2,float vy2) {

vy = -vy;

y = y+vy;

Update(0);

}

float Pong::getVx() { return this->vx;

}float Pong::getVy() { return this->vy;

}float Pong::getx() { return this->x;

}float Pong::gety() { return this->y;

}

Sprite* Pong::getSprite() { return this->s;

}

void Pong::setVx(float vx2) { this->vx = vx2;

}void Pong::setVy(float vy2) { this->vy = vy2;

}void Pong::Update(float dt)

{ Text *placar = placar->getInstance();

char straux[50];

int deslocamentoX = vx;

int deslocamentoy = vy;

int varRandom = 2*(rand() % 2) - 1;

if((x+deslocamentoX) <= 0 || (x+deslocamentoX) >= (640 - s->getRetangulo().w)) {

som->play(0);//ao tocar na parede toca o som vx = -vx; //e muda o sentido da bola

}

x += deslocamentoX;

if((y+deslocamentoy) < 0) { //ponto do jogador

char mensagem[50] = "placar: AI";

sprintf(straux,"%d",placar->placarIA);

strcat(mensagem,straux);

strcat(mensagem,"x");

placar->placarJogador++;

sprintf(straux,"%d",placar->placarJogador);

strcat(mensagem,straux);

strcat(mensagem," Jogador1");

placar->setMensagem(mensagem);

x=320;

y=240;

vy = vy*varRandom;

s->updatePos(x,y);

}

if((y+deslocamentoy) > (480 - s->getRetangulo().h)) { //ponto da ia

char mensagem[50] = "placar: AI";

placar->placarIA++;

sprintf(straux,"%d",placar->placarIA);

strcat(mensagem,straux);

strcat(mensagem,"x");

sprintf(straux,"%d",placar->placarJogador);

strcat(mensagem,straux);

strcat(mensagem," Jogador1");printf(mensagem);

placar->setMensagem(mensagem);

x=320;

y=240;

vy = vy*varRandom;

s->updatePos(x,y);

}y += deslocamentoy;

}

void Pong::render(SDL_Surface *surface) { s->updatePos(x,y);

this->s->Render(surface);

}Pong::~Pong() { som->~Sound();

s->Destrutor();

delete s;

}

Referências

[1] Minkyu Ahn, Jun Hee Hong, and Sung Chan Jun. Source space based brain computer interface. In Selma Supek and Ana Su²ac, editors, 17th International Conference on Biomagnetism Advances in Biomagnetism Biomag2010, volume 28 of IFMBE Proceedings, pages 366369. Springer Berlin Heidelberg, 2010. 10.1007/978-3-642-12197-586.18

[2] Diego Rielo Selim R Benbadis. EEG artifacts. http://autonomos-labs.com/, 2010. viii, 8, 11

[3] Patrick Berg and Michael Scherg. Dipole models of eye movements and blinks. Electro-encephalography and Clinical Neurophysiology, 79(1):36 44, 1991. viii, 9

[4] Hans Berger. Über das elektrenkephalogramm des menschen. Psychiatrie und Nerven-krankheiten, December 1929. 1

[5] Malcolm Brown, Michael Marmor, Vaegan, Eberhard Zrenner, Mitchell Brigell, and Michael Bach. Iscev standard for clinical electro-oculography (eog) 2006. Documenta Ophthalmologica, 113:205212, 2006. 10.1007/s10633-006-9030-0. viii,10

[6] Stephen Butterworth. On the theory of lter ampliers. Experimental Wireless and the Wireless Engineer, 7:536541, 1930. 28

[7] Burges C. J. C. A tutorial on support vector machines for pattern recognition. Data Mining and Knowledge Discovery, 2:121167, 1998. 18,39

[8] Andrew Campbell, Tanzeem Choudhury, Shaohan Hu, Hong Lu, Matthew K. Mukerjee, Mashqui Rabbi, and Rajeev D.S. Raizada. Neurophone: brain-mobile phone interface using a wireless EEG headset. In Proceedings of the second ACM SIGCOMM workshop on Networking, systems, and applications on mobile handhelds, MobiHeld '10, pages 38, New York, NY, USA, 2010. ACM. viii,x,21

[9] B.S. Chang, S.C. Schachter, and D.L. Schomer. Atlas of Ambulatory EEG. Elsevier Academic Press, 2005. viii, 8

[10] Jean Decety. Do imagined and executed actions share the same neural substrate? Cog-nitive Brain Research, 3(2):87 93, 1996. <ce:title>Mental representations of motor acts</ce:title>. 12

[11] G Deuschl and A Eisen. Recommendations for the practice of clinical neurophysiology:

Guidelines of the international federation of clinical neurophysiology. Elsevier, 1999. 13

[12] Emotiv. Emotiv home page. http://www.emotiv.com/, 2011. 14

[13] Roger M. ENOKA. Bases neuromecanicas da cinesiologia. Manole, 2 edition, 2000. 10 [14] R. A. FISHER. The statistical utilization of multiple measurements. Annalsof Eugenics,

8:376386, 1938. 28

[15] Germund Hesslow. Conscious thought as simulation of behaviour and perception. Trends in Cognitive Sciences, 6:242247, 2002. 12

[16] Knott JR. American electroencephalographic society guidelines for standard electrode position nomenclature. J Clin Neurophysiol, 8:200202, 1991. 13

[17] T Kirschstein. Wie entsteht das EEG? das neurophysiologie-labor. http://www.

sciencedirect.com/science/article/pii/S1439484708000112, 2008. 6

[18] Linden Lab. Second life, your world your imagination. http://secondlife.com/, 2003.

viii, 21, 22

[19] Johnny Chung Lee and Desney S. Tan. "using a low-cost electroencephalograph for task classication in hci research". "http://research.microsoft.com/en-us/um/redmond/

groups/cue/publications/UIST2006-LowCostEEG.pdf", October 2006. x, 2

[20] M Lotze, G Scheler, H.-R.M Tan, C Braun, and N Birbaumer. The musician's brain:

functional imaging of amateurs and professionals during performance and imagery. Neu-roImage, 20(3):1817 1829, 2003. 12

[21] Louizos Alexander Louizos. Braintalk project. http://www.nanotechgalaxy.com/

braintalk/, 2010. viii, 23

[22] J Malmivuo, R Plonsey, and J Cameron. Bioelectromagnetism: principles and applications of bioelectric and biomagnetic elds. Informa Pharma Science, January 1995. x,1, 13 [23] MasterMind. Mastermind project. http://senior.ceng.metu.edu.tr/2011/

mastermind/index.php/emotiv. viii, 15

[24] Paul L. Nunez and Andrew F. Westdorp. The surface Laplacian, high resolution EEG and controversies. Brain Topography, 6:221226, 1994. 10.1007/BF01187712. 26

[25] Surfdaddy Orca. Using your thought-controlled iphone

to dial home. http://hplusmagazine.com/2010/04/12/

using-your-thought-controlled-iphone-dial-home/. viii, 20

[26] "Satu Palva and J. Matias Palva". New vistas for -frequency band oscillations. Trends in Neurosciences, 30(4):150 158, 2007. 18

[27] G. Pfurtscheller, C. Neuper, A. Schlogl, and K. Lugger. Separability of EEG signals recorded during right and left motor imagery using adaptive autoregressive parameters.

Rehabilitation Engineering, IEEE Transactions on, 6(3):316 325, sep 1998. 18

[28] G. R. Muller-Putz1 A. Schlogl2 R. Leeb1, C. Brunner1 and G. Pfurtscheller1. BCI com-petition 2008 graz data set b. Institute for Knowledge Discovery, Graz University of Technology, 2008. viii, 24, 25,26

[29] Pfurtscheller G. Ramoser H., Müller-Gerking J. Optimal spatial ltering of single trial EEG during imagined hand movement. Rehabil. Eng., 8(4):441446, 2000. 18

[30] Raúl Rojas. Braindriver project. http://emedicine.medscape.com/article/

1140247-overview, 2011. viii, 19

[31] Adam Seeger Hans Weber Jerey Juliano Aron T. Helser Russell M.

Taylor II, Thomas C. Hudson. Vrpn tutorial : Sending data from an external application to openvibe. http://openvibe.inria.fr/

vrpn-tutorial-sending-data-from-an-external-application-to-openvibe/.

37

[32] Adam Seeger Hans Weber Jerey Juliano Aron T. Helser Russell M. Taylor II, Tho-mas C. Hudson. Vrpn: A device-independent, network-transparent vr peripheral system.http://www.cs.unc.edu/Research/vrpn/VRST_2001_conference/vrst_vrpn_

paper_reprint.pdf, 2001. 37

[33] Saeid Sanei and Jonathon Chambers. EEG signal processing. Informa Pharma Science, page 289, January 2007. viii,14

[34] A. Schlögl, M. Slater, and G. Pfurtscheller. Presence research and eeg. Proceedings of the 5th International Workshop on Presence, pages 911, 2002. viii,12

[35] A. Schlögl and G. Pfurtscheller. Eog and ecg minimization based on regression analysis.

January 2007. viii, 10

[36] Alois Schlögl, Felix Lee, Horst Bischof, and Gert Pfurtscheller. Characterization of four-class motor imagery EEG data for the bci-competition 2005. Journal of Neural Enginee-ring, 2(4):L14, 2005. 18

[37] K Stamps and Y Hamam. Towards inexpensive bci control for wheelchair navigation in the enabled environmenta hardware survey. Brain Informatics, pages 336-345, December 2010. viii, 2

[38] R.M. Suinn and R.D. Clayton. Psychology in sports: methods and applications. Burgess Pub. Co., 1980. 12

[39] Ana Luisa Miranda Vilela. Sistema nervoso. http://www.afh.bio.br/nervoso/

nervoso1.asp. viii,5

[40] Jamie Ward. The student's guide to cognitive neuroscience. Psychology Press, 2010. viii, 6

[41] G. Gibert M. Congedo E. Maby V. Delannoy O. Bertrand A. Lécuyer Y. Renard, F. Lotte.

Openvibe: An open-source software platform to design, test and use brain-computer inter-faces in real and virtual environments. Presence : teleoperators and virtual environments, 19(1), 2010. 29

Documentos relacionados