Autor Tema: On key release, find specs of game, how old os's can run?  (Leído 347 veces)


  • Newbie
  • *
  • Mensajes: 1
  • Karma: 0
On key release, find specs of game, how old os's can run?
« en: Enero 11, 2018, 08:11:47 am »
How would I do a key release function?
Código: [Seleccionar]
//rename the current level
            //Draw the dialog box
            //Draw the text on the dialog box
                text_z = -5; //this way its above the dialog box
                write(0,80,70,0,"NAME: ");
                write(0,80,90,0,"*rename the current level");
                //Type in the name
                temp_string = textinput();
            //level.filename is textinput()
                say("level.filename has been renamed to: "+level.filename);
        rename_pressed = true;
        rename_pressed = false;
Works when I press r, but it always types r as well. So I figure I can easily fix this by making it an on-release command. How could I make it so that this will work when I RELEASE the R key?

2. How would I find the specs for a game made in bennu?

3. How old of operating systems can run these games? Windows 3.1, Mac OS 9, Linux from the early 2000's, etc.?



  • Sr. Member
  • ****
  • Mensajes: 254
  • Karma: 9
Re:On key release, find specs of game, how old os's can run?
« Respuesta #1 en: Enero 11, 2018, 09:50:54 am »
Hi hoanghuynh,

For your first question, my strategy is use while loop after use the key detector in this way:
Código: [Seleccionar]
if (key(_a))
  //whatever that you want to do...

About your second question, if you are reffering about your game specs it will depends on the kind of things that you do. But in my opinion, is better a good CPU instead of a good VGA for run bennu games.

And about your last question, I don't know the answer.



  • Hero Member
  • *****
  • Mensajes: 6269
  • Karma: 159
  • Odio el periodo "entre proyectos"
    • La web de Drumpi
Re:On key release, find specs of game, how old os's can run?
« Respuesta #2 en: Mayo 12, 2018, 12:49:36 am »
Well, releasing the key works the same way as pressing the key: you need a variable to know the previous state of it, so

Código: [Seleccionar]
byte pressed;
if ((key(_a) && !pressed)
    //do stuff for just pressing the button
    pressed = true;
if (!key(_a) && pressed)
    //Do stuff for releasing the button
    pressed = false;

About the specs, as Arcontus said, it depends on how many process do you have, how much code they execute, how efficient it is, if you're using 8bits, 16bits or 32bits color mode, the use of rotation, transparencies, blendop tables... So the only way to know is to try your game in an old computer.

And how old can a OS be? Well, I think I had Bennu working on a W2000 and I think in a W98 in virtualbox. As long as SDL can be executed on that machine, Bennu can be run or ported.
Hala, como con 1001 procesos sólo va a 9 FPS, vamos a meterle 32 veces más, a ver si revienta.
(Drumpi epic moment)