brunopalermo's Forum Posts

  • Did you manage to open it? I can send you a C2 version if not.

    Here you go. Just finished porting it to C2. You can download it here.

  • There's no way to check this. Probably because there's no way to create a Layout dynamically so you would always know which layouts exist and which doesn't.

    What exactly are you trying to do? Why would you need such an action?

    Cheers!

  • You can check this example I just made.

    Click to add a "construction". After 60 seconds (online or offline) the "construction" will change it's state to "constructed" (square becomes green). You may close and reopen as you wish and the countdown will keep counting.

    Cheers!

  • It can be done like BadMario said. I would not save the timer itself, but, instead, save the start time of every action. When loading the game just compare the new time with the start time to see if actions are finished and setup timers if they're not.

    Hope this helps...

    Cheers!

  • I'm not sure I follow, but...

    In this method, since each enemy type is an animation, you should name your animations accordingly.

    For instance...

    You have 3 enemies, each with 3 animations (moving (0), shooting(1) and dying(2)). You should have a "type" instance variable set when creating an enemy.

    The Enemy sprite would have the following animations:

    • e0a0 - Moving animation for enemy type 0.
    • e0a1 - Shooting animation for enemy type 0.
    • e0a2 - Dying animation for enemy type 0.
    • e1a0 - Moving animation for enemy type 1.
    • e1a1 - Shooting animation for enemy type 1.
    • e1a2 - Dying animation for enemy type 1.
    • e2a0 - Moving animation for enemy type 2.
    • e2a1 - Shooting animation for enemy type 2.
    • e2a2 - Dying animation for enemy type 2.

    So, when an enemy dies you would "Set Animation" to "e" & Self.type & "a" & 2

    When an enemy is moving you would "Set Animation" to "e" & Self.type & "a" & 0

    And when an enemy is shooting you would "Set Animation" to "e" & Self.type & "a" & 1

    Got it? If it's not clkear, let me know and I'll add this to that example

    EDIT: I just updated that example so now every enemy has a moving animation and a dying animation.

    Move player with A, S, D and W. Aim with MOUSE and shoot with LEFT MOUSE BUTTON.

    Hope this helps...

    Cheers!

  • That's weird... I just tried here and it didn't work either.

  • This definitely shouldn't be hapenning, but without seeing your code, there's no way anyone can guess what may be causing it... :)

    Cheers!

  • You need to use the ::placeholder selector on your CSS. Unfortunately, you can only do this using a CSS file. I'm not sure Construct 3 can load them.

    Just discovered that since r158 there is a LoadStylesheet action for the Browser object. So, just add the Browser object to your project, create a CSS stylesheet as project file and load it.

    You can download this file and check how it's done.

    Hope this helps...

    Cheers!

  • This greatly depends on the phone. But any action that silences media sounds will automaticaly mute construct app sounds.

    Like I said. I just checked, using Audio actions, and there's no need to implement this, since the phone itself controls the sound settings, so, when it's in silent mode the sounds are already muted by the phone, no matter if you play them with the audio action in Construct.

    Cheers!

    I am not sure, but I guess the phone should do that automatically. It would override your sound settings.

  • You don't need a plugin. Just use the Browser object and "Execute javascript"

    Here's an example.

    Hope this helps...

    Cheers!

  • Is there a way to stop enemies randomly spawning right next to/on top of the player sprite?

    The easy way is to keep spawn points outside of the viewport. You would spawn then very close to the viewport but out if sight. This might not fit the concept of the game you're making. Another option is to add the player position to the calculation of spawn position. Or you can just reposition those that overlap, as I did in the example below.

    Is there a way to change the event sheet actions for all the enemy objects in one go if I'm not using the Family method, or do I have to add each enemy object separately?

    You may have all enemies in one sprite only. In that case you'd have to modify a bit the code I sent you.

    I updated the file I've sent before, so just download it and check the code.

    Move the player with the arrows. I greatly reduced the enemy spawn interval so you can see better how they never spawn over the player. Now, enemy types are different animations of ONE enemy only. Instead of picking an enemy, you just set their animations. Since they're one sprite, all behaviors are the same.

    Hope this helps...

    Cheers!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • My two cents... Forget groups. Create a function for firing weapons, a variable for current weapon and an array or JSON with the attributes for all weapons (rate of fire, aimation ID, etc). When firing a weapon use the variable to load the correct array or JSON values for that weapon.

    Here's an example.

    • A, S, D, W to move robot.
    • Mouse to point cannon.
    • Left Mouse Down to shoot.
    • 1, 2 and 3 to select weapons.

    Hope this helps...

    Cheers!

  • You don't need instance variables for that. Just have all three enemies as members of a family and select the family when creating the enemy. It will pick a random enemy from that family.

    If you can't or won't use families, you can just use Create Object (by name). Just name all enemies "enemy0", "enemy1", etc. And create "enemy" & floor(random(total_enemy_types))

    In this example I use both methods. Just set the Boolean "useFamilies" to true, for using families, or false for using create object (by name).

    Hope it helps...

    Cheers!