HessamoddinS's Recent Forum Activity

  • AllanR Thanks that was really helpful, I learned a lot

    The thing is I was trying to implement this effect in the background to the game I'm working on and I had plan to use a lot more than 100 sprites on the screen, which i think would not be possible. I just hope there was a more efficient way that could handle around 300 objects.

  • Asmodean ok thanks i will look into it

  • First, if you have performance problems. Put the events in groups, the less events in one group the better. Then check the CPU-Usage in the Profile-Tab in the Debug-Layout

    Your performance problem is the function call. You're calling the function from a loop and in the function there is another loop. You have up to 250 sprites and for each sprite you call the function, which is going again trough all sprites. That's an a amount of up to 62500 loops in one tick! (1/60 sec).

    I made a little change, don't know if that's still exactly what you want, but you will see I only check 2 sprites a tick, that will be call the function. So this are only 500 loops a tick.

    The change in the function you can ignore, it was only a test and it seems you're gaining nothing from this change.

    I hope I could explain this well enough, sorry for bad english.

    https://drive.google.com/uc?export=down ... TdYaFM2aHc

    Your code works but it has a problem. A Square can only connect to one square at a time, but I want squares to connect to all the squares that are in the distance of 50 or less pixels

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yes i know what the problem is. The loop inside the function makes the problem and that is why because i couldnt find a better way to compare the distance of each instance of a same sprite with other instances. So the whole idea is to create a line sprite if 2 instances are closer than 50 pixels with each other. So is there any better way to check the distance of each two instances?

  • Hi

    So I made something today, however it has high CPU usage. Here is the source file:

    https://www.dropbox.com/s/ap2hxpqlqoic2 ... .capx?dl=0

    (The code is messy and is not well written)

    Is there a more efficient way to do what i was trying to achieve?

  • Thanks guys helpful solutions

  • I have 100 of that sprite and i wanna check the distance of all of them with each other, so if the distance of one of the instances is less than 50 with another instance something happens to them.

    How can i do the above scenario?

  • How can I compare two instances of a same sprite?

    like if Sprite.X > Sprite.X

  • Hi

    So I found a way to create smooth shadow casting for circle sprites. here is a picture of the event: (But with this was using light radius could be tricky)

    (Sprite has Shadow Caster behavior)

    and then put a circle sprite on top of the rectangles.

    I even tested it with a circle size 1800 and it is still smooth and looks good. you can even add an option so people can decide how accurate they want their shadow to be.

    I think what i did do not need an explanation but if you want i can explain more.

    Thanks

  • Thanks for the news Ashley

  • Ashley are we going to get a plugin for this soon? If yes, will it support achievements for people who are in idsjh@xbox?

  • Does it mean we can integrate achievements, cloud saves and other stuff now?

HessamoddinS's avatar

HessamoddinS

Member since 4 Nov, 2014

Twitter
HessamoddinS has 5 followers

Connect with HessamoddinS

Trophy Case

  • 10-Year Club
  • Popular Game One of your games has over 1,000 players
  • Famous Game One of your games has over 10,000 players
  • Email Verified

Progress

13/44
How to earn trophies