andreyin's Forum Posts

  • You can also check if it's overlapping on an offset, instead of using image points, I think it's easier.

    Also check this code by R0J0hound for generating random "rooms", maybe it'll help you:

    scirra.com/forum/roguelike-map-system-untiled_topic51967_post327292.html

  • This is really cool, kinda hard at first but easy when you get used to it.

    The boss was really nice too!

    Answered the survey :)

  • LittleStain

    Thanks for the reply, I tried changing values around but still drags the ball down most of the time.. Decided to give up and use the pin behavior anyway, I "faked" the physics on it by setting the angle to "angle(ball.x,bally,tail.x,tail.y) + 180", then setting it back down whenever the ball is stopped.

  • Hey,

    I have a ball with physics on it, and I'm trying to attach a "tail" to it using revolute joint. The problem is that after I attach it, it kinda breaks the physic movement on the ball itself, when I try to throw it around.

    Is there a way to use revolute joint without affecting the physics on the object I pin it to?

    I tried using the Pin behaviour with the rope style and it kinda works, but it would look a lot better if there was a way I could use it as a revolute joint.

  • Magistross

    Oh wow, thanks a bunch, that's exactly what I was going for. I got as far as making the nested loop, but I had no idea you could use loopindex("nameoftheloop") haha. Thanks!

  • Hello,

    I've got a system going where I can load a tilemap when the game begins, and I'm wondering if there's a way to check for all the tiles on it so I can create objects as soon as it opens.

    For instance, here:

    <img src="http://i.imgur.com/CpCf3O3.png" border="0" />

    The tiles with sad faces are supposed to spawn enemies. So what I'm trying to do is:

    1. Create the tilemap

    2. Check if there are sadface tiles by using the tile number (it's number 9)

    3. Create enemies on their X and Y coordinates

    4. Erase them

    I think the ideal thing was to have a For Each Tile, but since this isn't implemented, I'm wondering if there's a way to check the X and the Y of the tilemap using regular for..

    Any ideas?

    Cheers.

  • Oh, I think I see what you mean now. Can't you just have a tile with every dot on the bounding box set to 0,0? It would still show up, but there would be no collision I think.

  • Hey, I've been thinking about this too and I have a different approach to it, but I still haven't made it so I'm not even sure it's doable.

    What I'm thinking about is having a "special" kind of tile in the tilemap, for instance, a "special wall" tile.

    When I load my tilemap, I was thinking of checking for said tile, erasing it, and creating an "special wall" object where it was. The same could be done for enemies, or anything else really.

    As I said, it's only an idea and I haven't gotten to the point to implement it yet, but since tiles are basically an array of tiles, I think it's doable. Also I wouldn't advise messing with tiles directly unless you're drawing on them or something, you wouldn't even be able to animate a tile if you wanted to destroy it or something, just erase.

  • Link to .capx file (required!):

    dl.dropboxusercontent.com/u/2383513/linkedOUT/tilemapbug.capx

    Steps to reproduce:

    1. Open Layout 1, select tilemap and draw on it

    2. Open Layout 2, do not select it and try to draw on tilemap

    3. Go back to Layout 1

    Observed result:

    The tilemap on Layout 1 is being draw onto, even though the tab is not open. Another problem is that after doing this, if you click the select tool on the tilemap bar and click the tilemap, and then select the edit tool and click the tilemap again, it still doesn't become editable. You have to unselect everything, select it and edit it.

    Expected result:

    Should unselect tilemaps when changing layout, or select the tilemap to be edited automatically when you have the edit tool on and click a tilemap.

    Browsers affected:

    None

    Operating system & service pack:

    Win8 x64

    Construct 2 version:

    r156

  • eli0s

    No problem! Also, when your sprite is mirrowed, you should use a negative angle in anglelerp, like this:

    <img src="http://i.imgur.com/fT6wHwQ.png" border="0" />

    Cheers!

  • Nice! Congrats!! :D

  • When using lerp for angles you have to use anglelerp! This got me stumped a few months ago too.

  • R0J0hound

    Oh wow, I see it now. All this math is too much for me lol.

    Thanks!

  • R0J0hound

    Yeah, I meant why, sorry.

    It's just so hard to get my head around that, I understood most of your code but this part...

    I get how you're generating the map though;

    1. Event sheet "load rooms" is called, new array is created, saves every wall and each exit;

    2. Map is generated on "Event Sheet 1" and based on that generation, you get rooms based on the exits it has (random door that has the same number of exits of the square on the map you already generated).

    I understand now that you can use booleans as 0 or 1, I had no idea.. but still, let's say that we have a room with 4 doors. That picture I posted would give a result of:

    roominfo.exitE+2*roominfo.exitS+4*roominfo.exitW+8*roominfo.exitN

    1+2*1+4*1+8*1 ?

    If you add and multiply it like that how can you still know which exits exist in which room?

    Sorry if that's simple, I'm not a very good programmer haha!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • R0J0hound

    Hey, sorry to bump this old thread but I've been looking into map generation and I loved your code, it does exactly what I want. I've been studying it so I can update it to use tilemaps instead of saving every wall to an array, but some parts got me really confused, like this one:

    <img src="http://i.imgur.com/eXQXBib.png" border="0" />

    How are you adding booleans like that?? D:

    Also thanks for the help!