Chris PlaysOldGames's Recent Forum Activity

  • Construct2 events have the following form:

    Conditions: ----------------------- Actions:

    ############################

    Condition1----------------------- Do this

    Condition2----------------------- And this

    (more conditions)------------- Etc

    -or-

    -else-

    etc

    (AND is implied)

    All Conditions must be "met"/true(unless inverted to be false or -OR- is used) before any actions in the event will activate.

    So by making a canShoot var (canShoot is made up.. you could use any name) and putting it in your firing event...

    Condition: ---------------- Action:

    ##############################

    Spacebar pressed ------ Create bullet at gun imagepoint 1

    canShoot = 1--------------canShoot=0

    ---------------------------------wait 1.5 seconds

    ---------------------------------canShoot=1

  • You need to use a variable...

    canShoot = 0

    Then in your firing event condition add canShoot = 1 and after you shoot set canShoot = 0 followed by a wait=(how long you want) followed by set canShoot = 1.

  • Construct2 reads from top to bottom through the "code" aka event sheets. So yeah it would activate the first ones it came to unless you took special steps... you could deactivate all of them before they start so it would always activate the right one.

  • Here is a thread of a similar nature, close to the bottom is a link in my post to a .capx I put together for him. It does more than what you ask... maybe it will help you get your head around how to do what your after.

    https://www.scirra.com/forum/viewtopic.php?f=147&t=182474

    Otherwise, it's pretty simple. Just make a variable called ammo. Every time you fire subtract 1 from ammo. When ammo = 0 set its value back to start amount and play reload animation/sound/ or message.

  • You have to "pick" the instance you want to act on or else all instances will be picked.

    In short you have to figure out a way to single out the instance you want to fire separate from the other instances.

    In my prototype space shooter in my sig I used the technique mentioned by currypuff. My basic enemy ship each shoot at a random time.. it works for the most part. Some of my enemies, however, are picked by distance from player and others using a collision with an invisible sprite barrier... you have to figure out what works for your specific need.

  • Please be more specific... there are many ways to do what you are asking and many different possible expectations.

  • Here is an old capx I made for a different but similar question. It does what you want but in it you click the gun picture instead of pushing 1 or 2.. same principle. Click on (A) "button" to fire.

    https://drive.google.com/open?id=0Bx-ufu2WID53MWFjT2owWEVEWHc (click the download arrow in upper right corner to download).

  • Yes, common issue. In my space shooter prototype in my sig I wanted the store to be an invisible/visible layer, not separate layout so I ran into the same issue.

    The way I got around it was to use groups. If you own the personal edition you can put each layers events into their own group (right click event sheet and select "create group", nest events under it). You can then activate/deactivate the group anytime you change menus and they will be turned off/on.

    If you don't own personal... you might be able to use variables to turn them off and on, but it would be very event costly.

  • 1. Check to make sure your device is not on fire, especially if it's a galaxy 7.

    2. Read this help on optimizing for mobile and see if any of it will help.

    https://www.scirra.com/tutorials/298/performance-tips-for-mobile-games

    3. Try running it through a browser on the device and see if it's still laggy, if so you know its not the game but phonegap or cordova where you need to focus.

  • Just for learning sake... you could also use a variable.

    on start - spawneralive = 1

    In the spaceship spawn event condition spawneralive = 1.

    When spawner destroyed add action - system set spawneralive = 0.

  • The problem comes in the way construct2 works. It runs eventsheets from top to bottom (more or less) 60 times a second. Even if you set a trigger once condition if it's conditions are true every tick it will keep activating... by putting it in a group and deactivating/reactivating group as it's needed/not needed then construct2 will only run it when it is active.

    I see no reason you couldn't use it in one layout you would just need to put all spacebar events in their own groups and manage when they are open/closed...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I would think you could, definitely not as easily. You would need to store the UID or IID (more here on them: https://www.scirra.com/tutorials/361/understanding-uid-iid-health-cards-and-rocket-smoke-trail of the first instance you click into a variable and then condition out that it is different than the second instance when button released. This is as simple as grabbing the first instance UID/IID with an action in its event that stores the value in a variable. Then in the event for the release of click grab the UID/IID of the object under cursor and condition out that is does-not-equal original stored UID/IID.

Chris PlaysOldGames's avatar

Chris PlaysOldGames

Member since 22 Aug, 2014

Twitter
Chris PlaysOldGames has 1 followers

Trophy Case

  • 10-Year Club
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Email Verified

Progress

12/44
How to earn trophies