dop2000's Forum Posts

  • Put this event inside the "Repeat 100000 times" loop, run the project in Debug Mode and see if there is any difference in CPU load and FPS.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Count me in.

    What will be the format of this course - text tutorial, youtube videos, Udemi course, paid/free etc.?

  • marceloborghi

    This is quite a bold statement

    A million sprites, with behaviors and events? I'd love to see some examples, and would definitely be interested to know how (if) this could be done.

  • add two instance variables to the sprite: StartX, StartY.

    On Start of the layout set StartX to Sprite.x, set StartY to Sprite.y

    On Drop - if dropped on a wrong spot, set Sprite position to (Sprite.StartX, Sprite.StartY)

  • Sure, you can add other instance variables to that family, say TargetGroup and TargetLayer.

    When family member is tapped, deactivate all popup groups and make all popup layers invisible, then activate only ButtonsFamily.TargetGroup and set ButtonsFamily.TargetLayer visible.

    Or you can create an event that runs every 0.1 seconds for example, checks layers visibility, and activates/deactivates corresponding groups.

    If you have lots of layers/groups, you can name them like PopupGroup1, PopupGroup2, PopupGroup3... PopupLayer1, PopupLayer2, PopupLayer3..

    and disable them in a loop:

    For "x"=1 to 20 ->

    ... Set group "PopupGroup"&loopindex deactivated

    ... Set layer "PopupGroup"&loopindex invisible

  • 1. This is the right approach. I do the same in my games. Alternatively, you can put events into different groups and deactivate/activate groups. For example, if menu buttons are invisible and should be disabled, deactivate Menu_Events group. When player taps Menu icon, deactivate platform controls and activate Menu_Events group.

    2. You can add another condition "Retry is on layer..":

    On Retry tapped

    and Retry is on layer "GameOverLayer"

    and layer "GameOverLayer" is visible

    On Retry tapped

    and Retry is on layer "PauseLayer"

    and layer "PauseLayer" is visible

    3. I also suggest adding "Wait 0" before making layer visible/invisible.

    Say, you have two buttons (MenuOpen and MenuClose) in the same position on the screen, but on different layers:

    On tapped MenuOpen -> Set layer "Menu" visible

    and layer "Menu" is NOT visible

    On tapped MenuClose

    and layer "Menu" is visible -> Set layer "Menu" invisible

    With events like this, tapping MenuOpen will make layer visible, but then the same tap will be registered in the next event on MenuClose button, and the layer will immediately become invisible again. Adding "Wait 0" before changing layer visibility will fix this problem.

    EDIT: you can actually optimize all these events by adding all clickable objects to a family, create a family instance variable buttonFunction, and make this generic event:

    On tapped ButtonsFamily

    ButtonsFamily is visible

    Layer ButtonsFamily.LayerNumber is visible -> Function call (ButtonsFamily.buttonFunction)

  • It depends on which effect you want to use.

    You need another sprite as a mask (white circle for example), put both sprites on the same layer (mask should be on top).

    Try applying different effects and/or blend modes to the mask sprite.

  • Here you go:

    Of course, you can do this in one formula, without the "v" variable.

    If you need a constant climbing speed no matter what the pole angle is, instead of "Set Y to self.Y+5" you can add an instance variable ClimbProgress (changing from 0 to 1) and then your event could look like this:

    Set X to lerp(spr_Pole.X, spr_Pole.ImagePointX("PoleTop"), ClimbProgress)

    Set Y to lerp(spr_Pole.Y, spr_Pole.ImagePointY("PoleTop"), ClimbProgress)

    Also, you should not change the angle of Physics (or Chipmunk) objects directly. Instead of "Pole->Rotate" you need to apply force or impulse to PoleTop image point.

  • 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.

  • 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)