dop2000's Forum Posts

  • Did you mean "swipe"? (Not "spin")

    If you want to detect swipe gestures, you can use Touch.SpeedAt(0) and Touch.AngleAt(0) expressions.

    For example:

  • Well, you can send me your project privately if you want.

    You can find my email here.

  • There is practically no difference in performance between using floor(random(17)) or choose(1,2,3...17).

    You can try them in "Repeat 1000000 times" loop and you'll see that both expression take the same (very little) time to compute.

  • Maybe your LOS settings are wrong - distance too short or something similar. It would be easier if you could share the project file.

  • That's just the AJAX tag name - "Animations". You can rename it to whatever you like, "ItemsArrayData" for example.

    Tags are needed in case you are requesting multiple files with AJAX and you need to know which is which.

  • That's way too many frames for a simple explosion! Why do you need 17 animations?! Just use one or two, randomly flip, mirror, rotate, apply some effect and you can save lots of memory!

    Also, you can make very resource-efficient explosions with particles. (see Particle Explosions template in C3)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Is the sound played? Maybe there is something wrong with the bullet (spawned on the wrong layer, for example). I suggest you add debug output (Browser->Log) to different events to see if they are getting triggered.

  • Array.width means the number of elements (or columns) on its X axis. In your case it's the number of items, +1 for the column with labels.

    I meant you should give your animations in the Items sprite the same names as you have in the array - "Spring_Helmet" animation, "Rock_Helmet" animation etc. It will make everything much easier.

    .

    You need to experiment, try other people's projects and tutorials, change different things, see what happens etc. This is the only way to learn in programming.

  • kriand beat me with the answer, but since I've already typed it I'll post it anyway :)

    In the array editor columns are X axis and rows are Y axis.

    For example, to get "Jump" property of Spring_Helmet, you can use Array.At(1, 4)

    The "FULL NAME" row from your table can be a unique identifier/code of each item. You can use the same code as animation name.

    So to pick a random item from the array you can do this:

    Set local variable randomItem to int(random(1, Array.width))
    ItemSprite set animation to Array.At(randomItem, 1)
    if Array.At(randomItem, 3)>0 : Set P1_Speed to Array.At(randomItem, 3)
    if Array.At(randomItem, 4)>0 : Set P1_Jump to Array.At(randomItem, 4)
    etc.
    

    Or you can create a bunch of functions to retrieve different stats from the array, as I did in the example I gave you in one of your previous posts.

    .

    PS: you should not use the first column of your array for labels. something like that is in better hands separately.

    Why not? He just needs to remember that X=0 is reserved for stats names.

    Having this column makes it easier to edit data in the Array Editor. Also it allows to create a universal function "GetItemStat", that will return any stat for any item, say Function.Call("GetItemStat", "short_sword", "damage")

  • Tom, Redirection still doesn't work for many old posts. If you try clicking links from FAQ, about 30-40% of them won't open.

    Also many external links completely disappeared from posts and comments. For example, half of the comments in this extremely useful post with audio resources now look like this:

  • Non-static local variables reset to their default value on every tick. So it's not possible to monitor them in Debug mode. You can only see static local variables.

    Use Browser-Log in events to output the contents of local variables to browser console.

  • You do not have permission to view this post

  • It's not recommended to use Physics together with other non-physics behaviors, but it's possible if you do it with caution.

    If you are using Platform or similar behavior to move an object, make sure that Physics behavior on this object is disabled. And when Physics is enabled, disable Platform. Don't move objects with enabled Physics using non-physics methods or by changing their position directly (like "Set X", "Move at angle").

    .

    Pathfinding plugin doesn't work well in platformer games, it's better suited for top-down view. Making enemy AI in platformer can be a tricky task, you can search the forum for some examples, try these links:

    construct.net/forum/construct-2/how-do-i-18/-how-do-i-frequently-asked-que-41236

    scirra.com/store/royalty-free-game-templates/super-platformer-ai-2462

  • See how the "On Turret2 shoot" event has a little green arrow on it? This means this is a triggered event. Try not to put triggered events nested under some other events, they should always be at the top-level!

    So try changing your code to this:

    Cannon1 On Turret shoot
     Cannon1 has LOS to Cyborgs -> Cannon1 spawn CannonFire
    

    The cannon will follow cyborgs, but only fire at them when they are in sight.

    .

    If you want your cannons to ignore targets that are behind obstacles, this becomes more complicated. In this case you should remove "Add target" action and use "Acquire target" instead. "Acquire target" assigns a specific instance of the enemy object to the turret.

    So your code could be something like this:

  • Maybe this has nothing to do with Construct. Open the Task Manager, Performance tab, see if there are any sudden spikes in CPU utilization.