tunepunk's Recent Forum Activity

  • Because the collision boxes are not set at the outer limits of the sprites, it would be awesome if there was a way to check for any colliding BBbox instead.

  • What are you up to? Boids ? Or something else? A picture will help people to understand the case.

    Im trying to optimize my Z Ordering routine to use less CPU for mobile, so I only want to sort objects that are nearby or overlapping. I don't want to create a lot of dummy sprites to limit the sorting to the ones that are overlapping, so i figured i would use distance instead. So what i need to do is to pick every sprite that is near another sprite, because theres no point to sort sprites that are not overlapping in any way.

  • I've been scratching my head for a while now and i cant figure out how to do this.

    I want to pick every object on screen that has another object within a certain distance. Whenever objects get clumped together i want to change some attributes.

    Pick by comparison: distance(block.X,block.Y,Family1.X,Family1.Y) < 120

    didnt work at all.

    Any ideas?

  • You might want to look at the Sine behavior.

    Here's how I'd do it. Cheap and easy !

    nice example. thanks! Thats not a bad solution!

    I managed to make it using the sin expression instead.

  • I googled a bit but I'm not a math genius but i think I have to add another value.. to add (Sagitta) af an arch to the 'offset' value.

    So now comes the REAL question. How do i write this formula in construct?

  • Have you tried to use the Physics behavior?

    I'm not quite sure because I never used it, but I think it might be just what you need

    I've tried it but it doesn't really work in this case. I'm basically just looking for a way to calculate an arc.

  • To clarify.

    Each bullet has 2 instance variables which i use to calulate the decline.

    "bullet.traveldistance" = how many pixels the bullet will travel before it's destroyed.

    "bullet.offset" = They Y offset of of the sprite following the bullet, based on the distances between the player and the traveldistance instance variable.

    When the bullet is created the offset is '-40' ... when the bullet reaches the endpoint the offset value is '0'

    So somewhere inbetween here i need to do some adjustments to the offset in order to get an arc.

  • I want to calculate a smooth curve for a sprite following my hidden bulle to simulate gravity in an isometric view.

    I can manage make a linear decline based on the distance travelled, but i want a smooth curve similar to what I'm trying to illustrate in this image. Is it possible with math/expressions to get that kind of decline? and what expressions calculations should I use?

    What I'm trying to achieve is to adjust the Y position (distance between the bullet and the sprite) following the bullet in a more curved fashion, rather than a linear decline (showed in red)

  • On a second note I also noticed that limiting the amount of true's at any given point is beneficial. Optimising the code to have as few true's as possible using more conditions like 'every X seconds', comparing distances, and other checks. etc etc.... Every time something is false, nothing is done, and the system moves on to next event.

    A good example is when I was Z ordering every object in a family (40+ objects on screen)... I managed to optimize this code from using 10%+ CPU to less than 1% just by limiting the amount of true, and still get the same result.

  • I made some tests on my game, and it turns out trigger once actually make a difference in many cases. I identified a couple of places where trigger once would make sense. And checking debug, those areas(groups) in the code went from using 0,8%-1.2%cpu to 0,1%-0.2% cpu. Let's say i have 20 places in my code where i can get this kind of benefit it all adds up to some serious processing power saving, which is really noticeable on mobile.

    Biggest difference was noticed on places where i used "For each"...

  • I noticed that chrome is performing very poor compared to IE when i test my game. My game in IE uses somewhere between 10-15% CPU att all times. In Chrome, my game uses 25% CPU, and even higher just by turning on debug mode. I've been trying to optimise events but i think i took it as far as I can. It's kind of funny... when i test my game in windows phone browser it performs better than chrome on my desktop... :p

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I love these type of top down racing games, can't wait to see how this turns out. Interesting that you made it point & click though. Never seen that before.

tunepunk's avatar

tunepunk

Member since 2 Mar, 2014

None one is following tunepunk yet!

Connect with tunepunk

Trophy Case

  • 10-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Coach One of your tutorials has over 1,000 readers
  • RTFM Read the fabulous manual
  • Email Verified

Progress

16/44
How to earn trophies