Esempio n. 1
0
bool game::run()
{
  bool keys[4];

  while(mRunning)
    {
      mNet->update(DeltaTime);
      waitsecs(DeltaTime);
      if(input(keys) == true) return 0;
      if(mNet->getType() == eClient)
        {
	  if(input(keys) == true) return 0;
	  if(keys[(int)eUp] == true)
            {
	      printf("up\n");
	      mNet->getEntity(0)->setCommands(mNet->getEntity(0)->getCommands()|1);
            }
	  else{mNet->getEntity(0)->setCommands(mNet->getEntity(0)->getCommands()&(255-1));}
	  if(keys[(int)eLeft] == true)
            {
	      printf("left\n");
	      mNet->getEntity(0)->setCommands(mNet->getEntity(0)->getCommands()|2);
            }
	  else{mNet->getEntity(0)->setCommands(mNet->getEntity(0)->getCommands()&(255-2));}
	  if(keys[(int)eDown] == true)
            {
	      printf("down\n");
	      mNet->getEntity(0)->setCommands(mNet->getEntity(0)->getCommands()|4);
            }
	  else{mNet->getEntity(0)->setCommands(mNet->getEntity(0)->getCommands()&(255-4));}
	  if(keys[(int)eRight] == true)
            {
	      printf("right\n");
	      mNet->getEntity(0)->setCommands(mNet->getEntity(0)->getCommands()|8);
            }
	  else{mNet->getEntity(0)->setCommands(mNet->getEntity(0)->getCommands()&(255-8));}
        }
      mNet->draw();
    } 
  return 0;
}
Esempio n. 2
0
void CreditDevkitArmandtonc()
{
	RegisterRamReset(RESET_GFX);

	REG_DISPCNT= DCNT_MODE0 | DCNT_BG0;

	tte_init_chr4c(0, 			// BG 0
		BG_CBB(0)|BG_SBB(31),	// Charblock 0; screenblock 31
		0xF000,					// Screen-entry offset
		bytes2word(1,2,0,0),	// Color attributes.
		CLR_WHITE, 			// White text
		&verdana9Font,			// Verdana 9 font
		NULL
		);

	vid_vsync();
	tte_write("#{P:35,60}Credit to Wintermute for devkitARM!\n");
	tte_write("#{P:35,70}Credit to Cern for Tonc!");

	waitsecs(7);
}