It's probably not the most efficient, as it checks the same tiles multiple times. But it works fast enough, so maybe not worth optimizing it further.
You can add 4 more events to check tiles at (x-1, y-1), (x+1, y-1) etc.
Here is a much simpler and faster version:
dropbox.com/s/mog16tzisjy0ddj/TileFloodFill-v3.capx
Or use a variable instead of Timer:
Variable lastKeyPress=0 On key pressed: ...If (time-lastKeyPress)<0.6 // double click .......Set lastKeyPress=0 ...Else // single click .......Set lastKeyPress=time
Develop games in your browser. Powerful, performant & highly capable.
You didn't put "Player.8Direction.MovingAngle" in the global variable definition, did you?
You should do this on every tick or when 8direction is moving. I recommend using system expression "Is within angle" or "Is between angles", they make life easier when dealing with angles. For example:
Player.8Direction.MovingAngle is within 20 degrees of 0 : set animation "Left" Else Player.8Direction.MovingAngle is within 20 degrees of 45 : set animation "LeftDown" etc.
This one?
dropbox.com/s/ru8v3e5q1bj7y9c/animationList.zip
—
Yeah, he explained in that post that his game has 5000+ events and using too many C2 addons. So moving it to C3 is not an option.
I actually doubt that fixing this issue with inactive behavior will help to improve the performance in any measurable way.
wertt22 Have you seen this addon?
scirra.com/store/construct2-plugins/gfx-plugin-c2-performance-4381
Are you referring to that green square on the left? Are you sure you don't have any semi-transparent object there? (like camera sprite)
Wow, I'm speechless! Thank you!!!
And what a great timing, my C3 license expires next week :)
I didn't really expect to win, because there were lots of strong entries. I particularly enjoyed playing A Night's Slide, At The Same Time and Bullet Jump. They are addictive, clever and fun. It's great that these games are getting prizes too.
Again, a big thank you for organizing this jam!
I'm not sure I follow. You need to change "Set angle" to "No" in 8Direction, and use Player.8direction.MovingAngle expression to determine which animation frame to select.
So you need custom palette in the Sprite Editor? You can submit a feature request here:
construct3.ideas.aha.io
It's probably easier to use some other image editor that has this feature, and then import sprites to Construct.
If you want to change colors in runtime, you have to do this with effects. For a single color you can use "Replace color" effect. For multiple colors you need a custom effect, like this one for C2, I don't know if any similar effects exist for C3.
Edit: never mind :)
This is a very popular question here, try googling "random not overlapping site:construct.net"
Here is the easiest way to do this:
dropbox.com/s/pvsdzodh8qfffah/RandomSpawnNoOverlap.capx
Replacing magic numbers in the code with constant variables is an improvement, but you are still hard-coding UIDs, which is bad.
It's better to use another instance variable like id or button_type.
The result will be the same. You can also simply set scroll X to player.X
Set layout scroll is often used when you want to do smooth scrolling, lepring, for example: set scroll x to lerp(scrollx, player.x, dt*4)