Excal's Forum Posts

  • I use event groups and comments on every major events block. Helps keep things organized and if I ever have to figure out what a section of events does, I read the comment above, saving time because I don't have to run through the events and figure out what it does by following the logic.

    Have a habit of taking a small break every 30 minutes of development to reorganize your event sheets, add comments, etc. It pays off in the long run.

  • You're right, I need to add a sound for when the alien ships are destroyed.

    Any features you would like to see? Currently on the to-do list is power-ups (like getting health back).

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Finally resolved my elastic collisions issues (or so I think and hope), and would now like some feedback on my game so far.

    All artwork used is royalty free or from a content pack, so please judge the gameplay and not artwork.

    Space Game

  • This is a problem I've had with posting links in the "How do I..." forum. When I post with a link to my .capx file, sometimes I get an error saying only users with 500 reputation can post links.

    I have 40 forum posts, all of which are in the "How do I..." forum with either a question or an answer. I currently have 306 rep. I have no idea how I am supposed to reach 500 reputation.

    There have been numerous times where I have tried to post a helpful reply with a .capx file only to get slammed with an error page telling me I do not have the rep required to post links. When I click the back button, I find that my entire post has been erased and I have to retype everything again. Often times I am frustrated and just refuse to retype my helpful comment, meaning my helpful post never sees the light of day.

    The reputation requirement for posting links on this forum should be lowered, probably to 250 or so.

  • Basically what happens after a collision is: pathfinding gets turned off, custom movement is used to simulate the 'bounce' caused by the collision, and then custom acceleration is added to decelerate the 'bounce'.

    Once the enemy's speed reaches zero or lower (due to the deceleration), it should start pathfinding again. However, it doesn't, and I can't figure out why.

    Here is the relevant events area:

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

    ImpulseCollision.capx

  • You can use the fill tool as well; just set the colors alpha to 0.

    I did not know you could create transparency with the fill tool. Thanks for the tip!

  • Here's an updated version of the .capx that features a text overlay showing the enemy and player forces applied upon a collision.

    ImpulseCollision.capx

    I'm starting to wonder if the physics library is bugged. Sometimes the force seems to be applied and the objects 'bounce' off each other, other times literally nothing happens and another collision happens between the two because neither has moved.

  • You can also try to use photoshop's or gimp's "magic stick". It's a tool that allows you to make selections by the color (or a variety colors and shades, depending on how you set it up). It always depends on the picture. If it has a very good contrast to the background, this tool might work quite nicely!!!

    For sprites where the magic wand tool is able to accurately select your sprite, this is a better option.

    Magic Wand selects sprite

    New layer via Cut

    Delete the lower layer

    And voila, you have just the sprite, everything else is transparent.

  • Click the Project folder in the 'Projects' tab. There should be a property called 'Starting Layout'. You can set it there.

  • You load the image as a sprite, then zoom in with the sprite editor and edit the image 1 pixel at a time using the eraser tool to remove the 'white' and add transparency.

    A little time consuming but that's how I did it for the walking character in my maze.

  • Also, you have it the player ship figuring out the momentum with it's own velocity, not the velocity of the enemy ship. :)

    Isn't that correct though?

    delta v1 = (m1 - m2) / (m1 + m2) * v1

    delta v2 = 2m / (m1 + m2) * v1

    If we say that v1 = Player velocity and v2 = enemy velocity, then delta v1 = player momentum change and delta v2 = enemy momentum change, so it would be:

    Player apply impulse of [delta v1] at angle Player.angle + 180 at Image Point 0.

    Enemy apply impulse of [delta v2] at angle Enemy.angle + 180 at Image Point 0.

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

    The impulse still is very strong, with some cases where the enemy ship teleports across the screen.

  • When I use impulse, the result of the collision (the two objects 'bouncing' off each other) is sudden. One second the collision happens, then suddenly the two objects are a considerable distance apart from each other. It doesn't look 'smooth' but looks more like teleportation.

    Here's my project with impulse instead of force - you'll see what I mean.

    ImpulseCollision.capx

  • So I've used the Apply Force at an Angle property in Physics for each object.

    For example:

    Player: Apply physics force (Player.Physics.Mass - EnemyCrescent.Physics.Mass)/(Player.Physics.Mass + EnemyCrescent.Physics.Mass) * Player.Physics.VelocityX at angle cos(Player.Angle) * (-1)

    I've done this for the Y direction, and then used the second equation for the Enemy object.

    However, I'm still not quite getting the effect I want.

    When the two objects collide, they appear to be stuck together. I've updated the live example above with my current version.

    Here's what my event sheet looks like for this part:

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

  • I'm trying to create a realistic collision between two moving objects, causing them both to bounce backward. I'm using it for my space game:

    Space Game

    Basically I'm trying to get the acceleration so I can apply a correct force to the collision.

  • How would one get the current acceleration of a moving object?

    I know that A = dv/dt, but I'm not sure how we would get dv. Can someone help me with this?

    EDIT: Here's my current line of thought.

    I have an object with a set acceleration of 120 and a max (capped) acceleration of 320.

    As long as the up arrow (causes player movement) is down, I would add 120 to the variable.

    As long as the up arrow is not down, I would decrease this variable by the built-in deceleration rate (hand-chosen amount, since I can't use physics friction coefficient without knowing what that deceleration rate actually is).

    As long as the down arrow is down (braking), I would decrease this variable by the braking deceleration amount.

    So really I would be tracking keypresses to track the (supposed) acceleration, and not actually getting the actual acceleration.

    Does this sound right? Is there a better method?