R0J0hound's Forum Posts

  • Updated the links in that old post. I found some older maze generators but it used a third party plugin i no longer have.

    -cheers

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If you want to use the bullet behavior, the simplest solution would be to set vx,vy in an event above the events I gave, and then setting the bullet angleOfMotion and speed in an event after.

    Vx = speed*cos(angleOfMotion)

    Vy = speed*sin(angleOfMotion)

    Speed = distance(0,0,vx,vy)

    AngleOfMotion = angle(0,0,vx,vy)

    The other equation you gave was for figuring out the initial speed to stop in a specified distance. From your description you don’t need that. You just need to slow it down.

    Global number speed=0

    Global number dir=0

    For each ball

    — set dir to angle(0,0,ball.vx,ball.vy)

    — set speed to max(0, distance(0,0,ball.vx,ball.vy)-200*dt)

    — ball: set vx to speed*cos(dir)

    — ball: set vy to speed*sin(dir)

  • I guess the issue is there is an infinite loop when two balls collide in your events.

    Anyways here's a better approach.

    When a ball hits a wall the ball is moved out in the closest direction from the wall and a bounce calculation is done with that direction.

    In a similar fashion when two balls collide they are moved apart and a bounce calculation is done.

    All balls are assumed to have the same mass and all the walls are not rotated.

    In events i used 16 and 32. That's the radius of the balls and 2*radius.

    dropbox.com/s/2apd1uwsnsylzpu/collision_responce.capx

    Damping can be done by multiplying the velocity by 0.995 or something. Angular damping doesn't make sense unless we are doing angular velocity too.

    If you want different masses or different levels of elasticity you can change up the bounce code with:

    en.wikipedia.org/wiki/Collision_response

  • You do not have permission to view this post

  • When you access value from indexes out of range then it always returns 0. Pushing 0 probably doesn't help with this.

    Anyways, Here's another idea to approach the idea. Check all values in uniqueArray before adding the new value.

    +---------------------------+
    |array: for each x |
    +---------------------------+
     local number match=0
     +-----------------------------------+
     |uniqueArray: for each x |set match to 1
     |array.curValue=uniqueArray.curValue|
     +-----------------------------------+
     +---------------------------+
     |match=0 |uniqueArray: push array.curValue to back
     +---------------------------+
  • You do not have permission to view this post

  • You do not have permission to view this post

  • You do not have permission to view this post

  • You do not have permission to view this post

  • You do not have permission to view this post

  • Here's a mess of previous topics. There are probably more.

    construct.net/en/forum/construct-3/how-do-i-8/math-result-text-line-145507

    construct.net/en/forum/construct-3/how-do-i-8/create-programming-language-138650

    construct.net/en/forum/construct-2/your-construct-creations-23/r0j0s-experiments-69314

    Specific to what you're going for here's this:

    More functions and expressions can be added in the "namelookup" function.

    dropbox.com/s/beavbwwu1usywyg/parser_example.capx

    It won't allow invalid syntax but the error messages need work.

    Anyways, the simplest would be to do a few string replaces and running the expression with the browser's execjs expression. However this isn't forgiving if there are syntax errors and can be a problem if some arbitrary js is run.

  • In the layout editor it only takes hex numbers. In events you use decimal numbers but you can use the set bit expression.

  • You do not have permission to view this post

  • Hi,

    Sorry for the late reply.

    Probably the simplest is to use a 32 character binary number of 1's and 0's. Each digit is a layer that you can make the object be in or not in.

    For example:

    1110 1010 1010 1111 1000 0100 1100 1011

    Then to input it into the layers property you need to first convert it to hex using google, or windows calculator.

    Here's one possible converter:

    convertbinary.com/binary-to-hexadecimal

    That binary number turns into this:

    EAAF84CB

  • Hi,

    For whatever motion you want to trace the future path of you’ll need a way to manually advance the object. Behaviors do that automatically every frame, but don’t give manual control to advance multiple frames.

    Logic overview would be:

    1. Save position and velocity

    2. Loop 100 times

    3. — move object a bit

    4. — handle collisions and bounces.

    5. — plot point

    6. Restore objects pos and vel

    Number 3 is pretty easy with an object affected by gravity.

    Add gravity/60 to Vy

    Set position to x+vx/60, y+vy/60

    Number 4, the collision detection and response is a topic of its own. Usually back up the object out of the wall, figure out the angle of the wall and do a bounce calculation.

    Anyways, that’s what you could do in any Game creation software.

    You may be able to do a hybrid approach with constructs features.