dop2000's Forum Posts

  • Use the border coordinates. If your border is a sprite, you can use Border.X or Border.BBoxLeft, Border.BBoxRight

    Or simply fixed values:

    Sprite is dragging: Set x to clamp (self.x, 200, 400)

  • Perhaps you need to use other values instead of ViewportLeft and ViewportRight

  • So object #1 should be dragged by simply touching anywhere on the screen, right?

    If #2 is a large invisible background sprite with Drag and Drop behavior, then on drag start you can attach #1 to #2 as a child with hierarchy. Then #1 will move with #2. On drop - remove the hierarchy.

    And while dragging limit the position of #1:

    Object2 On Drop
    OR Object2 is dragging : Object1 set x to clamp(self.x, left_border, right_border)
    
  • You can pass Array.AsJSON and set array from JSON string. But of course it's still cumbersome to use.

    Another option is to create multiple instances of array object, then you can store different data in each instance and pass array.UID as a parameter.

  • if param(x) == 0 && param(x+1) == "Set" >> set varaible to 0.

    Are you still using the old Function object? You really should update it to built-in functions. You will be able to name and set a proper type for each parameter.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Don't worry about it, most apps work this way. The Android OS decides when to unload each inactive app from memory.

  • Use a calculator:

    (mouse coordinates-tilemap position)/tile size

  • Yeah, I have the same error when using the latest NWjs version 82.

    The remote preview works fine with NWjs 75

  • Mikal's new Greengrinds addon has this condition. EDIT: and the official Greenworks plugin too!

  • Yeah, that's one way to do it. You can also use a binary value - see the documentation for setbit and getbit expressions.

    Another option is to use 4 variables: Fire, Earth, Water, Air. They can be boolean, but I prefer to use number variables with values 0 for false and 1 for true.

    Then when fire attack is placed in any slot, you set Fire variable to 1. When water attack is in any slot, set Water to 1.

    Then you can use them to build the name of the bullet template:

    Set TemplateName to BulletType
    
    If Fire=1 : Set TemplateName to (TemplateName&"_fire")
    If Earth=1 : Set TemplateName to (TemplateName&"_earth")
    If Water=1 : Set TemplateName to (TemplateName&"_water")
    If Air=1 : Set TemplateName to (TemplateName&"_air")
    

    Or a shorter method:

    Set TemplateName to BulletType & (Fire=1 ? "_fire" : "") & (Earth=1 "_earth": "") & (Water=1 "_water" : "") & (Air=1 : "_air": "")
    

    As a result you will have a string like "nova_fire_water", even if the water was added first in the first slot.

  • I was planning on doing most of my damage and modifier coding directly on each sprite.

    Actually, yes, you can do this instead of using the array. You can use a single Bullet sprite with multiple animations in it (bullet, bomb, nova). And add a bunch of instance variable to the sprite - "damage", "effect" etc.

    Then put 40 copies of this sprite on unused layout, set their animations, configure each copy for a specific attack, and set them as templates. For example, a bullet for fire+air attack may look like this:

    Then you can spawn a bullet from this template and it will be created with all the correct values and the correct animation. You will need a single action for all 40+ attacks!

  • First of all, it was a wise decision to ask for advice before starting to develop the game! I've seen too many examples where people did the opposite.

    While you can create 40+ boolean variables and code each of the attacks separately, this won't be a good solution. Such code will be difficult to manage and worst of all - it won't be expandable. Imagine if you decide to introduce two new elements later, when the game is almost ready!

    So my suggestion is to use some data object to store all attacks and their properties. Here is a example with an array:

    I chose an array because it's easy to edit in C3, but there are other options - JSON, CSV (Excel), XML etc. In fact, I would probably use the array for entering and editing data, but convert it internally to JSON in runtime.

    With all the values configured, you will only need 3 variables to start an attack and your code can look something like this:

  • Remove the silence at the beginning/end of the music track in any audio editor. I'm using GoldWave.

  • Desktop build of C3 has been retired. You can probably find and download an old version of it, but it may not work correctly.