dop2000's Forum Posts

  • If there are performance issues, try increasing the tile size to 2x2. The edges will look a little bit rougher but the performance should be much better.

    I just noticed than in my demo there are 2 identical instances of tilemap object, one on top of another. And it still works pretty fast

  • I think you need to install NW.js

    https://www.scirra.com/manual/162/nwjs

    Then when you export your project from Construct 2, there will an option to select NW.js and it will make the .exe file.

  • I think you need to add gamepad number after "Gamepad":

    angle(0,0,Gamepad(0).Axis(0,0),Gamepad(0).Axis(0,1))

    angle(0,0,Gamepad(1).Axis(0,0),Gamepad(1).Axis(0,1))

    etc.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Is there a reason why you need JSON?

    You can install Rex's CSV plugin:

    It's great and I'm using it heavily in my games.

    Another option would be parsing CSV into 2D-arrays with events.

    This is quite easy -

    First loop breaks the file into lines using tokencount/tokenat and line break as separator.

    Second loop breaks each line into values with tokencount/tokenat and comma as separator.

  • Do you see if question object actually contains any text after you click it?

    Maybe there is a space before/after the word? Try adding trim() to remove all spaces and line breaks.

    If question.text is empty, maybe you need to add Round or Int before Random(0,26).

    Also, in event #3 you can use loopindex instead of i.

    If nothing helps, could you share your capx?

  • How can I control which player will be controled by which gamepad. I added player number variables.

    See my first comment.

    Before the game starts, ask each player to press a button. Save gamepad number for each player in a variable/dictionary/array.

    When in the game a button is pressed on gamepad N, you will know which player pressed it.

  • Yeah, if you need very complex (or non-polygon, rounded etc.) shapes and pixel precision, the only option is canvas plugin.

    Or you can make some shapes like pixel-perfect circles, ovals, sine waves etc. with math formulas.

  • matriax

    Yes, your method of building tilemap is definitely better if buildings are rectangular. With complex shape buildings you might need to check overlapping for every pixel.

    What do you mean by sprites with alpha? Your buildings will have transparent parts ("windows") and you want to remove tiles in windows?

    You can make windows as another separate invisible sprite.

    So first you fill tiles where building sprites are, then erase tiles where window sprites are.

    Edit: Made a demo, with complex-shaped windows!

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

    Cheers for the coffee! <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

    Although it's all based on R0j0's original idea, you should be thanking him.

  • Here is an idea - set "Blend mode=source atop" for buildings and use tilemap as a mask. (and also as a solid surface for tanks)

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

  • I used it to output debug information (Browser->Log)

    https://www.scirra.com/manual/110/browser

  • Yeah, the order of conditions in an event matters.

    "If spr_test.var=0 -> Pick a random instance" first picks all instances with var=0 and then selects one random from them.

    "Pick a random instance -> If spr_test.var=0" first picks a random instance from all instances, and then checks if its var=0. If var<>0, the whole event will not be executed.

    By the way, you can optimize this code a bit. If you add Sprite1, Sprite2, Sprite3 to a family, you can spawn SpriteFamily and a random sprite will be created.

    For each spr_test Order By random(1) -> spr_test Spawn SpriteFamily
                                            spr_test Destroy
        If loopindex=4                   -> Stop loop   
    [/code:1xsq5tgj]
    
    That's it!
  • Oh, I know what could be the problem. Local variables in functions lose their values after wait.

    So you need to move all actions with wordScore above "Wait 2 seconds":

    Also, when Attack button is pressed and you return all letters to their start positions, you should also clear "isOccupied" variable for Sprite133.

  • It does work.

    If the word is entered correctly, then wordScore variable will contain the score for this word.

    Say, in my example the word "sensei" will give wordScore=12 and the word "itadakimasu" will give wordScore=20.

    Then it's up to you how you use this value. You can do "Skeleton subtract wordScore from Health".

  • Ok, since I recommended storing the list of all words in a single variable, I guess I have to help you with this one <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

    Here is an updated file:

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

    Note, I used an older version of your capx, from the previous post. So you should only take the code in Battle Animation group, ignore everything else.

  • Unfortunately, you can't do it in C2.

    When I need to delete an object in a big project, what I usually do is I rename it to something unique like "Delete12345".

    Then save the project as a folder (not as capx) and search all .xml files for "Delete12345".