R0J0hound's Forum Posts

  • If you have the center angle you can do something like

    set angle to centerAngle+calmp(angle(0,0,cos(angle-centerAngle),sin(angle-centerAngle)), -45,45)

  • NES graphics were done with tiles like you say, but most games made use of larger sprites by combining multiple tiles together. You could look for an nes emulator with a debug view to look at it I guess.

  • You could use the canvas or paster plugins to draw.

  • Probably the easiest is to have a lot of variables as follows. Pos is a value from 0 to 1 that when used with lerp can give an angle between the start and end angles.

    variable start_angle

    variable end_angle

    variable pos

    every tick

    --> add dt to pos

    pos>1

    ---> set pos to 1

    every tick

    ---> set angle to anglelerp(start_angle, end_angle, pos)

    Start of layout

    ---> set start_angle to 0

    ---> set end_angle to 90

    ---> set pos to 0

    That's the long version. You can simplify it but it becomes less readable.

    The "start of layout" condition is an example how to use it. You need to set the start and end angles and reset pos to 0.

    Also the transition will take one second. You can make it faster or slower by adding another value to "pos".

    Ex.

    2*dt for 0.5 seconds

    0.5*dt for 2 seconds

    0.1*dt for 10 seconds

    Finally it's a linear angle change, although you can make it ease in-out by changing:

    anglelerp(start_angle, end_angle, pos)

    to

    anglelerp(start_angle, end_angle, cubic(0,0,1,1,pos))

  • FunkY Koval

    In JavaScript all numbers are double precision, so I doubt it's an issue with a layout that size. It would be the same with any other behavior.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • in your code "obj" is a list of instances, not one instance. In which case obj.runtime is undefined, and thus the error.

  • When you use an object as a parameter the runtime gives you an object type. From that you can get a list of picked instances or a list of all the instances of that type. Iid is just an index in the instance list. The sdk manual should have all the info needed to do that, and for examples on how to do it look at existing plugins to see how they do it.

  • All wait does is delay the following events from running. To make it conditional it's probably simpler to use something else like a variable used as a timer or the timer behavior.

  • You should be able to fix it by selecting the non asm.js physics setting in the project properties. That error is cased by asm.js only being able to use a fixed amount of memory and when you create a lot of new physics objects (like changing a tile does) then eventually it will run out of that fixed amount of memory.

    Now it could be argued that the memory management of the asm.js version of physics is broken, since even if all the physics objects are recreated every frame, then the total amount of memory needed should be the same.

  • I guess it depends on what version of windows you have. The latest I've tested as working is win7 32bit I believe.

    That dll is an update for dx9. Typically you get it installed with dxwebsetup.exe that's in Construct's install directory. The link fm4fanAT posted should be basically the same. If windows won't let you install it then that's an issue on their end,

    Copying dlls over manually probably has it's issues as well, such as other dlls it depends on or relying on 32bit windows or something. It probably can be done but I'll probably not look into it further.

    You could always look here and see if this works:

  • Tested and I can reproduce. It removes the first action.

  • Radulepy

    I don't get that error in the example I posted, even with more than 20 enemies, so I maybe you do something different in your capx.

    In most cases a javascript error is a bug so maybe try making a minimal example that causes it and post it in the bugs section.

  • There are two ways.

    One is to do 5bit like you have above

    If a tile is blue start with 256

    And if the tile is red start with 512

    Then add the surrounding tiles.

    Blue tile values

    0 1 0

    2 0 8

    0 4 0

    Red tile values

    00 16 00

    32 00 128

    00 64 00

    If you looked at the tiles around an empty spot too there would be a total of 1024 combinations. Which is a lot to draw.

    To knock down the combination count you can put some restrictions.

    The simplest would be to have each tile type on its own layer, and do bitwise on it's own layer.

    More complex setups could be done depending on how you want it to look.

  • Basically it's done by looping over all the pieces and flood filling to the other pieces of the same color. Use a variable to label each group and to make the pieces that were processed already.

    The only optimization is to use an array to do a piece lookup instead of picking by collision or general picking.

    Here's an example to peruse:

    https://dl.dropboxusercontent.com/u/542 ... match.capx

  • Here's a recent example of making a callback:

    Basically you add the function object ad you can then use:

    c2_callFunction() in javascript to call a c2 function.