drmidnight's Recent Forum Activity

  • well my game is a "catch stuff as they fall" game and there are other stars too so I'm setting it up where I ad one to streak everytime you catch a 1 pt star but its reset to zero on other stars and space junk.

    Edit: IT WORKED!!!!!

    Now I just want to ask how can I give ten bonus points for every ten one point stars that are caught.

    Basically the same way. Just create a variable that is increased by 1 every time a star with a value of 1 is caught, then when that variable = 10 give them 10 bonus points and reset it.

  • Well, physics collisions are accurate. The problem is with the normal collision/overlaping check. What would be nice is to have physics objects as detectors/triggers. That way we would have accurate detections either upon collisions, or while overlaps.

    I am not sure what is the purpose in your gameplay, if you are trying to simulate penetration damage. I did some checks and came up with a basic capx that does detect all collisions, perhaps it will be of some use to you. Perhaps not. Here it is never the less

    Thanks for the example, but this is similar to what I was already doing. The problem is if you increase the impulse or make the board any thinner it will start to miss collisions.

    I ended up settling for an invisible cage around small objects that is much larger than the object itself, and then getting the distance and moving the impact point to the object. It works fine for what I wanted to do.

    There isn't really any gameplay purpose, just a prototype for ballistic behaviour that I wanted to mess around with. I'm going to put it aside for now and revisit it later after some other ideas.

  • Well look at the math. If an object is going faster than 60 pixels per second, and your solids are smaller than 60 pixels, then there's a high probability it can skip the object.

    You're just not going to get pixel perfect collisions in a javascript engine running v synced at 60 fps.... with crappy garbage collection.

    Makes sense. I guess I could try doing an invisible cage object that is much larger and then offset the impact point.

  • Something like this?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If you are using the bullet behavior, there isn't much you can do. If you are using the physics behavior, perhaps setting the "bullet" property on the bullet sprite might improve things out. Although a quick test I did with the bullet sprite set to fired with an impulse of 1000, worked perfectly, without even having to set the bullet property to "yes". In fact I don't think that the physics behavior allow for that kind of high velocities. 1000 impulse has the same speed as 10000 or 100000000....

    Oh well...

    I have the physics property set to bullet and it still fails to register hits that fall out of the "step" range and increasing the stepping does nothing.

    What is odd is I am only applying an impulse of 0.6......

    I think I might just write a custom behavior to do a trajectory/ delayed hitscan and do away with the bullet all together.

  • Instead of having the score reset when it hits the ground, just create a streak variable( -1 for off 1 for on) and have the cumulative variable reset when the streak variable is off.

    I'm not sure how your game is set up, but when you miss a star just have it set the variable off or just have it reset the cumulative variable. It should be pretty easy to set up from the example I provided.

  • No problem, you could also do a streak variable if you don't have a ground object.

  • Here is a simple example, left click to spawn a dot , arrow keys to move the player.

  • Have a variable that is incremented each time a player catches a star and have it add to your score each catch and reset to 0 when you miss one.

    You could also have an instance variable on the star itself which will increment by 1 each time a new one is spawned if the player is on a streak.

  • I was messing around with a "realistic" bullet penetration prototype and currently the detection of the collisions is less than desirable. Currently it completely bypasses any object smaller than the green box and will sometimes even skip it at its current size.

    It runs fine locally at mostly 60fps, but this is just a messy prototype so don't expect the best performance. Firing too fast seems to wreck the fps in some cases also sounds might repeat or not play etc etc.

    I have tried altering the stepping of the physics object, but this seems to have no effect.

    I saw a posted example of pixel perfect collision detection, but unfortunately the performance was lackluster and used a messy loop that caused the cpu to hit 100% after 50+ shots.

    Not looking for a concrete example, but anyone that can point me in the right direction would be much appreciated.

    Trying not to get too heavily into the math side of things, but I'm thinking custom movement and some trajectory equations might have to happen.

    Test:

    WASD = Move gun around

    R = reload

    X = clear all lines/magazines

    Left click = fire

    B= Enable blood

    https://dl.dropboxusercontent.com/u/14181859/bullet%20Test/index.html

    EDIT: Updated the example to adjust velocity and fixed it so no matter what angle you shoot it should go out the right side.

    Green = less than 50% the original speed

    Yellow = between 90-51% original speed

    Reload your cache or load it in a incognito tab to see changes.

    Still can't get the collision to work right on thin objects, but I am working on another prototype using custom movement and some trajectory formulas.

    Got it to be a little more accurate but not much.

  • If you are looking for simple waypoint movement, check out

  • Fixed a couple issues with my monokai theme I was noticing while using it the other night.

    Save as XML

drmidnight's avatar

drmidnight

Member since 26 Apr, 2013

None one is following drmidnight yet!

Trophy Case

  • 11-Year Club
  • Email Verified

Progress

12/44
How to earn trophies