dop2000's Forum Posts

  • Here is the easy way:

    System->Every random(2,3) seconds

    ...System -> Pick random instance of object -> spawn object

    The better way is to add Timer behavior and start an individual timer for a random period on each instance.

  • I like the screenshots, but I can't tell you whether or not you should buy C2, it should be your decision

    And unfortunately, I don't have time for big projects.

    I suggest you post on this forum:

    I still can help with some small coding issues if they arise.

  • The graphics is really nice! It genuinely looks like an old-school isometric rpg.

  • You didn't give enough information about your game.

    That third sprite - is it some random user-defined image? Then you'll have to use Canvas plugin.

    If this is like "guess the color" game, where you can define the color of third sprite, you can make it with "Set color" effect.

  • You can't refer objects in C2 by their string name.

    What you can do is add all these text1,text2... objects to a family TextsFamily, create an instance variable "code" on the family, and then you'll be able to pick any object (member of the family) by code.

    For example:

    TextsFamily compare instance variable code="text4" -> TextsFamily set Text to "abcd"

    Same approach with sprites.

  • Check image points on the turret.

    Origin image point is the "center" of the sprite. You can move it to where you want it to be. Also, you can define other points, for example "FirePoint" on the tip of the cannon, where bullets will be fired from.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yes, if you use "wait" in a loop, you can't access any temporary variables (local variables, loopindex expression, function parameters etc.) after the "wait" action.

    You need to use either global variables, instance variables or static local variables.

    For example, this will not work:

    For i=1 to 10 -> Wait 0.5*loopindex ; Create Sprite at (loopindex*50, 200)

    You have to change it to something like this:

    Local Static variable x=0

    For i=1 to 10

    ... Wait 0.5*loopindex

    ... Add 1 to x

    ... Create Sprite at (x*50, 200)

  • You can convert both ways:

    Set number=int("2")

    Set text=str(2)

  • facecrime

    find(Object.myStringOfNumbers, "2")

    If this returns a number >=0, this means that "2" is found.

    But, if your string is long and contains numbers with multiple digits ("0,7,8,12,22,729") , if you need to find exact number 2, you should search for ",2," string.

    With lists like this it's better to use tokenat/tokencount

  • There are a number of expressions you can use:

    to parse a string with a list of values separated by comma or some other symbol - use tokenat(), tokencount()

    For example:

    For "x"=0 to tokencount(text, ",")-1

    ...value = int(tokenat(text, loopindex, ","))

    to search for a substring - find()

    Other expressions:

    left

    right

    mid

    len

    etc.

    https://www.scirra.com/manual/126/system-expressions

  • Both sprites should be on the same layer, mask sprite should be above the pink square, mask sprite should have "Destination out" blend mode.

  • I started replying, then got distracted and tarek2 beat me

    Yeah, the problem is that all these events are executed on every tick (unless they are sub-events under some parent event, it's not clear from the screenshot).

    If these events are top-level, this means that the animation is restarted again and again on every tick and lots of "wait 1.83" threads are created... It could be a total mess.

    You need to use Else:

    Health=4

    Else Health=3

    Else Health=2

    etc.

    Otherwise when health is for example 1, all four top events are triggered.

    Or add another condition - check if animation is playing:

    Health<=4

    (and) Heart5 is "HeartDestroy" is NOT playing

    Alive=0 condition is also triggered many times and restarting the animation...

    You can add "Trigger once while true" to it or set alive= -1, to prevent if from triggering again.

    Also, don't use long-running "Wait" actions, you don't have control over them. Use Timer behavior.

  • You should try again, because it does work. Make sure the "hole" sprite is on top of the main sprite. And both sprites are not on the bottom layer.

  • raymond91 , It may sound stupid, but check maybe this behavior is already added to the object?

    Or it could be added to the family, if the object is part of the family.

    Timer behavior has no properties, so it's hard to notice.

  • You can use Touch.AngleAt(0) and Touch.SpeedAt(0) to recognize gestures.

    Here is a demo I made for another post:

    https://www.dropbox.com/s/tetv3j8m1psww ... .capx?dl=0