dop2000's Forum Posts

  • I'm sure, this can easily be done with asin() expression, this is basically a school-level math. The problem is, I don't remember it :)

    So here is a workaround - change the magnitude gradually over a short period of time. You can do something like this:

    Set newMagnitude=100
    On every tick: sprite Sine set magnitude to lerp(self.Sine.magnitude, newMagnitude, dt*4)
    or:
    On every tick: sprite Sine set magnitude to min(self.Sine.magnitude+1, newMagnitude)
    
  • When you spawn a family, you can't control which family member will be created, it's random.

    So you need to create the object explicitly: "if currentweapon=laser, then create laser, else if currentweapon is missile, then create missile" etc.

    Alternatively, you can ditch the family, combine all these sprites into one as different animations. Then on "Z" pressed, you spawn this one bullet sprite and only need to change its animation.

  • LiteTween is the greatest addon for tweening, you won't find a better one.

    Just set Tweened Property=Value, and set sprite angle to Sprite.LiteTween.Value on every tick while the tween is running.

    However, I just tested and it looks like you can do this by tweening the angle directly. Say, if you want to rotate your sprite 30 degrees clockwise, tween to (sprite.angle+30). If you need to rotate counter-clockwise, tween to (sprite.angle-30)

  • newt Well, of course it's not iterating like "For" loop, the actions in the event are not repeated Object.PickedCount times. But internally, when the engine determines which instances should be picked, it iterates through all instances and compares each with choose(0,1), in each iteration calculating a new result for choose(0,1). It would make more sense to calculate it only once before running this loop.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • here is an example I made just yesterday, you can modify it to your needs:

    dropbox.com/s/mvllis416491ywn/SlidersTwoLayouts.capx

  • I'm pretty sure you can.

  • Try Browser.Language expression

  • You do not have permission to view this post

  • It's interfering with Preview, Remote preview and exported HTML5 game.

    Here is a related link:

    discussion.evernote.com/topic/114013-web-clipper-chrome-extension-steals-javascript-keyup-events

  • Dayvid86 There are lots of online editors, for example:

    sceditor.com

    wysibb.com/demo

  • Spent many hours yesterday trying to figure out why my game doesn't work properly on some computers - keyboard events get stuck, "Key is down" condition always return true for some keys, "On key released" is never triggered etc.

    Turned out that Evernote Web Clipper extension was causing all these bugs.

    Oddly, this was only happening with C3 runtime, in C2 runtime keyboard was working fine.

    This is a very popular extension with millions of downloads, so be aware.

  • Almost. You need to remove the "Else" part. Reset the boolean variable to 0 at the beginning of the function (or you can use local variable by the way). And only set it to 1 when array contains value, don't reset it to 0 when it doesn't.

  • I updated my example, re-download it.

    You can use Tween instead of Sine. Move cards sideways with Tween. On tween end, change their z-order, then move back to the deck.

  • It's difficult to figure out by your screenshots, but one mistake I noticed is that you are using arrInventory.CurValue in event 193. CurValue expression is only available in "Array For each element" loop. It will not work in System-For loop. But, the problem with Array-For loop is that you can't stop it, so you'll need to rewrite some of the code.

    Besides, your events 192-193 are inside the For loop, so they are executed multiple times. I think the structure of your function should be like this:

    On function checkProhibitedItems
    ...System For x from 0 to arr.width-1
    ......arr contains 
    ...prohibitedItemsLoop=arr.width : success
    ...Else : fail
    

    Also, prohibitedItemsLoop counter is not a good indicator that the array doesn't contain prohibited items. What if the prohibited item is the last element in the arrInventory? The loop will stop at the end, but the function will still return "success". I suggest using a boolean variable "prohibitedItemFound" instead. Set it to 1 if array contains prohibited item.

    .

    Finally, try running the game in debug mode and also add Browser-Log actions in key events to print some important information, like variable values etc. This will help to understand what's going wrong.