Yann's Forum Posts

  • Your HUD is weird, why is you hudTowerSelectBoxes a pair of square?

    Explain a little more of what you want, a schematic can help.

    Also don't create another topic about the same subject, you'll make things harder since you'll have to explain your problem again.

  • First, you can't refere to an object by the name of its object type in a create action. So CreateObject varAvailabTowers.at(ROW,COL) at (X,Y) isn't really possible like that.

    However there's a work around: put all your different tower in different animation frame of the same object, and store this data in your array.

    I don't have enough information to really grasp what you want to do, but it looks like you have a map in your array that holds the position of some towers.

    So basically the creation process should look like:

    Global number gridX = 0  // X position of top left corner of the map
    Global number gridY = 0 // Y position of top left corner of the map
    Global number cs=32  // grid cell size
    Global number cols = 10 // number of columns of the map
    Global number rows = 10 // number of rows of the map
    + On Start of layout
    + For "y" from 0 to rows-1
    + For "x" from 0 to cols-1
      -> Create mapObject at (gridX + loopindex("x")*cs , gridY + loopindex("y")*cs)
      -> mapObject: set animation frame to map.At(loopindex("x"),loopindex("y"))

    If your mapObjects have some animation, you should suffix the animation name with an ID and use a private variable to identify the object.

    The last line would be changed to

      -> mapObject: set objID to map.At(loopindex("x"),loopindex("y"))

    Then you will just have to always play your animation like that:

     -> mapObject: set animation to "Attack_"&mapObject.objID

    With this technique you can not only place towers but any object you want to set (trees, bushes, rocks, etc) The only downside is that you can only have one object per cell (unless you use a 3D array for layering)

    That's all

  • R0J0hound

    Hehe! That's what I call an elegant implementation.

    I thought about representing cubes in 3 dimensions but I thought it would be over complicated to handle grouped rotation and local orientation.

    Looks like I was wrong.

  • My best guess if your bug happens in firefox, is that the button keeps the focus when you click on it then key input aren't received anymore unless you click somewhere outside the layout.

    Annoying behavior.

    Work around: make your own button with sprites.

  • Any way, That's my take in the rubik's cube idea

    rubiksCube.capx

    Need rex's function plugin

    demo

    Press SPACE to display face's IDYann2012-07-09 04:58:06

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Also as you bought c2 you can try to use one of the sprite packs...

    (uh Ashley looking at your badge, you bought C2 too but not as an early adopter? :D)

  • left(right("000"&milliseconds,3),2) then.

    Or right("00"&str(floor(milliseconds/10)),2)

    Something like that

  • AnD4D

    Try right("000"&miliseconds,3) instead.

  • Then you can have a boolean per key you switch to true on key pressed to lock the other key pressed event.

    Having an action like "disable key" will basically do the same thing under the hood I think.

  • Wight

    To get the values the nth row in a 2D array

    It's just simply :

    global number n=3 //check the third row
    + foreach X element
      Set current_value to Array.At(Array.CurX,n)

    For the fact that we can't get a 3D cube, I think Yanen was well aware of that. There are however some solutions to fake 3D in construct2 (check r0j0hound's raycasting example). I think for a rubik's cube there's some solution using non-uniform scaling to fake the rotation.

    As for writing function, rex made a function plugin that works super well, I'm using it on a level editor I'm making. Ashley will probably make an official one at some point but for now it's good enough.

    Anyway, for now it looks more like you're better in php than in construct2.

  • You can have a boolean named "Acting" you switch to true when you start any action. And then you just have to put all you action triggers in a sub event of "is Acting"

    Then you just have to have a condition checking that the character isn't doing anything to switch "acting" back to false.

    If you have more complew locking relationship you just need to add other booleans to check states.

  • At once or over time ?

  • There's something missing in your rubik's cube: when you rotate the top row the top face should rotate as well (:

    Also, I'm pretty sure the whole thing is doable with one 3D array (maybe another one for swapping values, but it should be doable in one array using unused offseted indexes). Also it's pretty challenging. Don't have time to try though.

  • gravityShip.capx

    The radius was properly calculated, just not properly displayed, your text object was too short, and it's also better to round the values.

  • This is more a matter of composition than anything else.

    So the answer is: it depends.

    Draw a mockup level and deduce the size of your character from it. Keep in mind that you might adjust it after some playtest though. So wait before creating the final artwork.