R0J0hound's Recent Forum Activity

  • For 2d you can just use the distort map to bend the road in curves. For 3d the problem of using a textured road and placing objects becomes a full 3d one except the math has to be done yourself. You can use z with distort maps so the drawing capabilities are there. To position objects you'll have to set the zelevation on sprites as I recall.

    About the curving in the example, that's all it is. I never refined it to look right.

  • Picking with sprites has to check all the currently picked sprites. Tilemap tiles on the other hand aren't picked, you select them directly based on tile location.

    I don't quite follow your description but if you have a "for each" which calls a "for each" with no "pick by evaluate" and 4000 instances you'll get 4000*4000 iterations. With picking you'll get much less depending on what's picked. On another note picking is run over all the picked instances so an event by itself that uses "pick by comparison" will have to run the comparison on all 4000 instances, and since functions reset picking, each time it's run 4000 comparisons will have to be made. So again a total of 4000*4000 comparisons.

    Tilemaps don't do picking on tile. Checking any tile only takes 1 check. It can be refered to as a spacial hash.

    overall sprites can be anywhere so you need to loop over all of them to find one in a specific spot.

    Tiles are in specific spots so you can just check that spot to find the tile.

  • The 3d effect can be done like in here:

    For just curving sprites in 2d you can use distort maps.

  • That doesn't look like a plugin. Look in the other plugin folders to see what files a plugins is expected to have. The main two files c2 is looking for is runtime.js and edittime.js. If you can't find those files for what you're trying to install then it may not be a plugin.

  • The issue of the wall being a grid is purely a cosmetic one. In the attached capx cells are even positions in the array and walls are odd. After the maze is generated I loop over the cells and choose an animation frame for the sprite based on what walls are around the cell using this equation:

    right + 2*down + 4*left + 8*up

    You could also just as easily create thin walls around the cell depending on what walls are there.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Instead of setting the animation frame, you can set an instance variable of each card. Then you can make a boolean variable for each card and call it "face up". If the boolean is true you set the animation frame, and if it's false change the animation to a face down animation frame.

  • Well, 1/8th is 12.5% which is 13% when rounded. So one core is being maxed out. Pat finding uses web-workers so do a lot of pathfinding to Engadge the other cores.

  • Here's an example of a way to display the position of cars in a racing game:

  • wouldn't using "pick by evaluate" followed by a "for each" work? Or do you mean the issue of comparing two instances of the same type?

    For the latter, yes you could use an array. One idea would be to pick by evaluate, loop over the picked sprites and store any values you need. Then you loop over them again, checking with the values saved in the array.

    For instance you could do the following to do something for any sprite that has another 32 pixels to it's left.

    pick by evaluate

    --> set array size to (pickedCount, 3, 1)

    -- for each sprite

    ----> set array(loopindex, 0) to sprite.uid

    ----> set array(loopindex, 1) to sprite.x

    ----> set array(loopindex, 2) to sprite.y

    -- for each sprite

    ---- array: for each x

    ---- array at (array.curX, 1) = sprite.x-32

    ---- array at (array.curX, 2) = sprite.y

    ------> do something

    If instead all objects are positioned in a grid you can make it much simpler and faster.

    Start of layout

    --> array: set size to (20,15,1)

    -- for each sprite

    ----> set array(int(sprite.x/32), int(sprite.y/32)) to 1

    pick by evaluate

    for each sprite

    array at (int(sprite.x/32)-1, int(sprite.y/32) = 1

    --> do something

    You'd just need to update the array if an object is moved.

  • Leaufai

    One way to do the front shock is with a groove joint and a spring.

  • With the physics behavior the only way is to use a family. So if your objects are "sprite" you need to add that to a family then in events pick one object with "sprite" and the other with "family".

  • One idea is to use a canvas. 1st paste the character and then paste with "destination-out" anything in front of the player. Then loop over all the pixels of the canvas and see if any pixels aren't transparent. The main issue with that is it's very slow.

    If you can treat the player as a square it can be done much quicker.

    For instance to check if a player's bounding box is inside another box you can do this:

    box.bbleft<=sprite.bbleft

    box.bbright>=sprite.bbright

    box.bbtop<=sprite.bbtop

    box.bbbottom>=sprite.bbbottom

    It would become much more complicated if you wanted to know if multiple boxes covered the sprite completely. It would probably require splitting the bboxes up.

    Another idea would be to loop over the positions of the sprite and 1st check if the point overlaps the sprite then see of it's overlapping the object's above the sprite. It could be slow too but you also could do a more coarse check by not checking every point.

R0J0hound's avatar

R0J0hound

Member since 15 Jun, 2009

Twitter
R0J0hound has 157 followers

Connect with R0J0hound