Zoglu's Forum Posts

  • That's awesome !

  • Yet this option exists, and is very useful as long as it works, IMO

  • Thanks for the advice, and keep up the good work

  • I did it.

    Maybe the final object count when I add the While depends on the PC's speed. My PC is quite slow (1.6 Ghz processor, and a very, very old graphics card).

    Anyway I hope you'll find why it doesn't work

  • Hi,

    I've found what could be a little bug, or maybe it's just me who doesn't do it right (I'm new to Construct), so I preferred asking for help before

    At first there are 1250 "Sprite" objects on my layout. I want to remove them so there are only 800 "Sprite". I know there are hundreds of methods to do so, but I tried using this code :

    System: Start of layout
    

    Sprite2 : Set 'OBJ' to Sprite 0 .Count

    Sprite2 : Value 'OBJ' Greater or equal 800

    Sprite: Pick one at random

    Sprite2 : Subtract 1 from 'OBJ'

    Sprite : Destroy[/code:2nxww7id]

    So it removes one "Sprite" at each tick until the number reached 800. But in order to remove all of them at once, I've added a "While" condition so they could be destroyed more quickly. This is what this cap does : http://www.zoglu.net/trucs/bugwhile.rar

    However, when I run it in the end there are about 860 sprites, while the "Sprite2"'s variable 'OBJ' has reached 800. Like if sometimes the variable was decremented but no "Sprite" was destroyed.

    Also, if I try to replace the "Sprite2 : Subtract 1 from 'OBJ'" by a "Sprite2 : Set 'OBJ' to Sprite.Count", it goes into an infinite loop. That's weird, because one "Sprite" is supposed to be destroyed at each loop, so the object count should decrease.

    So... I know I'm not following the best way to do it, but it definitely looks like a bug. Or maybe I'm just doing it wrong from the beginning. What do you think about this?

  • Thanks for the helpful answers everyone.

    And thank you Lucid for the cap file, and telling about the "use expression" option, I don't think I would have find it

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Lucid : I would like it to work with any keys.

    Deadeye : That's it. The only workaround I've found is adding a "control" for every possible key (in the Manage Controls window of the application properties) and then use the "Control is down?" condition, which allows an expression to be entered. But that's really tedious and don't allow to check what is the last pressed key (unless I add like 200 events to test for each key).

    And yes, I'd like to make a custom controls setup in my game, exactly what you said

    As what I want to do doesn't seem easily possible, should I add it to the Feature Requests ?

  • Hi everyone !

    I'm new to Construct, but I've been using MMF2 before (like many members here I guess). I'll go on a more detailed presentation if you want it, but now I've got a question.

    MMF2 has a quite useful object, "Control X", which allows to retrieve the last pressed key and to check whether a particular key is pressed, using values. For instance, the Space key is associated to 32, and you can add conditions to test if the key 32 is down.

    Is there a way to do this using Construct?

    The Mouse & Keyboard doesn't let me write an expression when I want to test whether a key is down, it just includes a menu. And I didn't find any way to retrieve the last pressed key as a value.

    Thanks in advance and sorry if the question was already posted somewhere.