single variable increase

Posted By: Sorrowful

single variable increase - 01/18/13 16:32

Code:
///////////////////////////////
#include <acknex.h>
///////////////////////////////
var dakika;
var saniye;
var degis_id=1;

BMAP* a1 = "1.bmp";
BMAP* a2 = "2.bmp";
BMAP* a3 = "3.bmp";
BMAP* a4 = "4.bmp";
BMAP* a5 = "5.bmp";
BMAP* a6 = "6.bmp";

FONT* arial = "Arial#40b";

PANEL* resim_goster =
{
	pos_x = 190;
	pos_y = 50;
	bmap = a1;
	flags = SHOW;
}

TEXT* sure_txt =
{
	pos_x = 70;
	font = arial;
	pos_y = 500;
	string("Süre");
	flags = SHOW;
}

PANEL* sure =
{
  digits(160,500,2,arial,1,dakika);
  digits(220,500,2,arial,1,saniye);
  flags = SHOW;	
}

function main()
{
  vec_set(screen_color.red,vector(30,30,30));
  video_window(NULL,NULL,0,"So&#287;anl&#305;k Talebe Yurdu Bilgi Yar&#305;&#351;mas&#305; - Hadi Anlat Bakal&#305;m!");
  while(1)
  {
  	if(key_cur==1)
 	degis_id = degis_id + 1;
  	if(key_cul==1)
   degis_id = degis_id - 1;
   if(degis_id==2)
   resim_goster.bmap = a2; 
   if(degis_id==3)
   resim_goster.bmap = a3; 
   if(degis_id==4)
   resim_goster.bmap = a4; 
   /*if(degis_id==5)
   resim_goster.bmap = a5; 
   if(degis_id==6)
   resim_goster.bmap = a6; 
   if(degis_id==7)
   resim_goster.bmap = a7; */ 
   wait(1);
  }
}




I press Cur but degis_id=4 ??

I want to go to the individual
Posted By: rayp

Re: single variable increase - 01/18/13 16:58

Maybe u hold the key to long ( its a while ). U could test its out.Try if this solves the problem
Code:
..
 	if(key_cur==1)
 	degis_id = degis_id + 1;
  	if(key_cul==1)
   degis_id = degis_id - 1;
while (key_cur) wait(1);
while (key_cul) wait(1);
..

Does this help ?
© 2024 lite-C Forums