Zetar's Forum Posts

  • I am using lerp to show wind increase every second. I got it working from a small number to a large number of wind speed, but how do I get it to work the same for Big number to small?

    Here is what I have:

    Every Sec:  
    ->Set LERP_SPD=Lerp(Curent_Speed,End_Speed, 0.1)
    ->Set Current_Speed to LERP_SPD
    
    ----->LERP_SPD>End_Speed-0.009:
    --------->Set End_Speed to random(0,10)
    [/code:336gp7xz]
    
    So what it does is look at current wind speed and lerp it to the end_speed in increments of 0.1.  Then when it reaches the end speed (minus 0.009 to kill the wait at it nears the end number) it creates a new speed to lerp to.  BUT if the new end speed is lower than the Lepr_spd, it just jumps to the low number then lerps forward.  I want it to lerp to the low number just as it does to the high number...
  • Hello all. I am playing around with grid movement using Tilemap as solids. Currently, I spawn a sprite to see if it overlaps a direction I want to go, then move to that tile if it is not overlapping my tilemap (actually, move to tile is not working... so I just move 32 pixels in that direction... Help on this would be appreciated too.). However, it moves on top of the tilemap anyways... Any way you can tell me what I am doing wrong? It randomly picks a direction. Just watch it for a few and it will wander onto a wall and get stuck.

    https://app.box.com/s/35bn07kzibimi2q93quf

  • I think it is included with the current download actually... right click on the background and "insert new object". You should see it in the options to add...

  • Add the item like adding a sprite, then when you create events you will see it. It is an OBJECT called Functions

  • That would be kind of cool; to have another way of visually finding info in your comments...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Check out the link above - you may get some help from there...

    As for the air part, it depends on how you do it. Are you using tilemap, or sprites, or something else for the ground? There are to many variables to answer this without looking at a capx, i think...

    Except for this: You would probably place a sprite over the "air"/"non-air" spot, and do an overlap evaluation: if sprite "is overlapping another object":ground, do this or that (or inverse it for NOT overlapping)... However, again, we need to know more about what you are trying to do...

  • shinkan, I agree. I was incorrect in how I was using the Tiletoposition*, however I believe the x/y coordinates are off and are a bug in both the Posiotiontotile* and Tiletoposition*. Ashley, can you comment on if this is a bug or not, and If I need to re-post it I will.

    Check the x and y output of Positiontotile* and Tiletoposition* and compare to window x/y positions.

  • So, OK... I went ahead and spent a few hours putting together a quick example of how I would do a MineSweeper clone. I call in Ninesweeper... Dont click the 9s. It is real basic, and is not EXACTLY like the mine version, but it might help get the creative juices flowing.

    https://app.box.com/s/6liwytg3tct2fhiyxqyk

    Instructions...

    Right Click [ ] to show a tile.

    If you click a 9, the game is over and all the tiles will display.

    If you click a 0, all 0's will display.

    Right click to mark a [ ] with a [X] so you dont click that tile. (If you think it has a 9...)

    Again, there is A LOT that can be improved...

  • I don't know of a tutorial exactly like that, but parts would be easy and others not so much.   If this is your first run in C2, I recommend looking at a few tutorials to see how the events process and such.

    I would set up an Array to be the size of the minesweep grid. You would have to either manually enter the 0s, 1s, 2s ect OR write an event to proceduraly generate the numbers. (That might be hard...) Then draw a grid of sprites (or learn about the tilemap object and use it) on the screen. Add the Mouse object so you can set up something like

    ON CLICK MOUSE_>

    - If over gridtile->

        - {use variables or something to find the location in the array} and compare those variable to the array value

            - Change the sprite and any nearby sprites according to the array values (there is a lot to this procedure...)

    I dont have the time to put a template together, but it would be a neat little setup if you can get someone to get it started for you...

  • Actually, This is kinda weird... I have been having problems placing items in the exact spot since the update... Re-run your project and click on the Project folder and change the Fullscreen in browser setting to off.(on the left).

    You should now see it center a bit better, but it is still off... I made the window and layout 800x600 and a sprite at 800x600 and when I center it as you state above it is about 1/2 inch to the right and down... This may be a BUG... anyone else want to verify this on their own?

  • Link to .capx file (required! If link is blocked remove the http and www parts):

    app.box.com/s/i81gjuzlmgjdyozz9xbc

    Steps to reproduce:

    1. Run .capx

    2. move mouse and observe mouse.x and mouse.y in text field 1

    3. compare mouse.x and mouse.y in text field 2 using TileToPosition(mouse.x) &?:?& TileToPosition(mouse.y) over the Tilemap object.

    Observed result:

    The mouse.x and mouse.y position used in Tiletoposition() exponentially increases as you move the mouse even a pixel at a time, while the normal mouse.x and mouse.y show the correct pixel location of the curser.

    Expected result:

    Shouldn?t the Tiletoposition() give the x and y location of a certain tile center as long as the mouse is over the certain tile? OR at least show the correct layout x and y position of the mouse?

    The positiontotileX & Y do the same weird measurements

    Browsers affected:

    Chrome: yes

    Firefox: yes

    Internet Explorer:

    Operating system & service pack:

    Windows 7

    Construct 2 version:

    r162

  • Here is the capX I used to show this...

    app.box.com/s/i81gjuzlmgjdyozz9xbc

  • OK, so I was having problems getting an object to re-position to a Tilemap Tile. I added a text field and set an event to give me the Tilemap TileToPositionX(mouse.x) and same for Y. I have the tilemap bounding box centered on the screen. I also have the left click tell me the mouse.x and mouse.y when off the tilemap object.

    Why when I click to the left of the tilemap object I get the correct Mouse.X (222) and Mouse.Y (170) BUT

    When over the tilemap a few pixels to the right it gives me

    TileToPositionX(mouse.x)= 7537 and 5566 for Y?

    I do not understand the discrepancy...

  • Ugh... My head hurts now... I am glad someone is learning from this post. LOL!!!! (P.S. Im still not 100% on it myself, but at least I understand the basics.

  • I forgot to change the collision mask in the physics of each item to CIRCLE - not bounding box... That helps the orbit calculation a bit - so try it with that setting to see how it changes the movement... (The mass calculation will changes a bit, causing the calculations to change.)