keepee's Recent Forum Activity

  • I did a basic gravity simulator a while ago but lost the .cap file

    i remember the equation though

    multiply the two masses, and then divide by the distance between the two.

    you can then multiply that whole thing by a constant to fine tune how strong you want it.

    i was using physics so it was

    ((body.physics.mass*body2.physics.mass)/distance(body.x,body.y,body2.x,body2.y))*constant

    apply that force to both the body's towards each other. It worked perfectly

    edit: i forgot, the distance between the bodies was squared

    http://en.wikipedia.org/wiki/Newton%27s_law_of_universal_gravitation

  • Link to .capx file (required!):

    https://dl.dropboxusercontent.com/u/53374990/Forum/bugs/r154AsymetricalCollisionMasks.capx

    Steps to reproduce:

    1. preview .capx

    2. press space to toggle physics off and on

    Observed result:

    If a physics object has an asymmetrical collision polygon, and an offset origin point, the collision polygon gets screwed up.

    this is new to r154 & was not present in previous versions, including 153 when asm was inserted.

    it happens regardless of using box2d web or ASM

    Expected result:

    Browsers affected:

    Chrome: yes

    Firefox: yes

    Internet Explorer: untested

    Operating system & service pack:

    win7

    Construct 2 version:

        154 only

  • I think what you read was referring to is the 'is overlapping' condition, which isn't a trigger, you can place it below other conditions.

    but for the 'on collision' trigger, you can work around the way it forces itself to the top by just making it a sub event to a blank event.. i've done it a few times and i've not noticed any bugs.

  • have you tried using the 'is clockwise from' condition?

    you can invert it for anti-clockwise

    using the angle related stuff in c2 should work regardless of whether the angle is negative or above 360 or whatever.

  • do you mean how to make an object snap to grid?

    if so you can do:

    set object x to round(object.x/8)*8

    and replace 8 with whatever gridsize you want, or a variable

    do the same for Y

    if your hotspot is in the top left corner, use int() instead of round()

  • ALLMarkMade

    Do you mean local vars or private vars?

    local variables are created the same way global variables are. If you drag a variable to be subevent, it becomes a local variable... and vice versa.

    The only difference is that Global variables are always Static, but you can make local vars static too. Static means it remembers what the value of the variable is after each tick.

    And then private variables are ones which are held by an object or a family.. so they are not created on the event sheet.

    The manual will explain these things better than me though.. so it's better to read about them there. Is there anything in particular about the .capx that you don't understand?

    emoaeden

    So do you want a particle effect to be created and destroyed for each fan when toggled active? Because you can do the exact same as what i've done for the 'fanarea' object. If you replace every occurence of 'fanarea' with the particles equivalent, it'll probably help you understand the .capx better. And then you can modify it to have both the fanarea and the particles together.

    Other people may choose to do this in other ways though, for example you could have the particles and fanarea both in a container for the fan.. that means they will always exist in the game, not be created and destroyed unless the fan is. In this case you have to some more toggles -set the particles active/inactive, and only apply the force when the fan is active also.

  • hey, this might help

    https://dl.dropboxusercontent.com/u/53374990/Forum/fans.capx

    click fans to toggle them on/off..

    the fans force is stronger the closer the object is.. If you don't want that, lose the calculations and just apply F

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Link to .capx file (required!):

    https://dl.dropboxusercontent.com/u/53374990/Forum/bugs/EventShortcuts.capx

    these are all somewhat related so i hope you don't mind me putting them in one post

    The .capx is annotated, so skip this and read it there.

    1. With blank condition space selected, pressing right will not select the events actions

    2. having multiple events or comments selected prevents all arrow key navigation

    3. pressing C to create a condition, places it at the bottom of the conditions list, instead of at the selection highlight. Same goes for actions and pasting.

    4. up/down navigation still selects events that are omitted by search.

    5. pressing ctrl+f expands ribbon even if search box is placed on quick access bar.

    Operating system & service pack:

    win 7

    Construct 2 version:

        151

  • cheers legend, one more post coming

  • Do you mean a mini-map like in RTS/Moba games or do you mean a completely separate large-scale screen like in 'Grand strategy' games.. or do you mean where the whole game is played like in Civilisation?

    either way you should be more specific...

  • Families, bro.

    Check out the manual page on them, it will explain better than me

    but in short:

    If you create the family 'tower', and give it some variables, all the objects you put into 'tower' will inherit that family's variables.

    You can then refer to the family 'tower' in the events sheet like it was any other object.

  • if you do mouse.x("layername"), it returns the right x on that layer, regardless of zoom.

    also the max() expression returns the highest number entered.. you can use it instead of the subevents regarding the edge boundary..

    max( mouse.x("layername"), 0) will return 0 if mouse.x is below zero

    There's also min() and clamp() which have similar uses.

keepee's avatar

keepee

Member since 6 Jan, 2012

None one is following keepee yet!

Trophy Case

  • 12-Year Club
  • Email Verified

Progress

13/44
How to earn trophies