Home Artists Posts Import Register

Content

So I mentioned making a quick video on the new 2.1.5 collision functions? Here it is! It actually kinda was quick.

It's mostly what I did in the livestream explained.

Enjoy!


PS: Also, LUDUM DARE 42 is this weekend! I'm not totally sure if I'll be doing it yet, but I might be. If I am, I'll be streaming over the weekend!

-S

Files

GameMaker Studio 2 - Multiple Collisions Tutorial

Shout outs to version 2.1.5! Using new functions like instance_place_list we can get an ordered(!) list of collisions very easily! ▶ Support my work: https://www.patreon.com/shaunjs

Comments

Anonymous

Hey Shaun, I was wondering if there is any particular reason why you used a repeat loop and not a for loop? I may be wrong, but wouldn't it be more performant if you would use a for loop and with that are able to realize the code without the need to delete items from the ds_list? Like: for(var i = 0; i < hitcount; i++){ with(ds_list_find_value(_hitList, i)){ if(i == 0) image_index = 2; else image_index = 1; } } or am I missing something?

shaunjs

weirdly repeat has proven faster than for loops when tested! This does contradict the theory of these tools and Mike D himself has suggested for loops should be used when you have an incrementer like this but funnily enough, tests have shown otherwise! It's marginal though, I mostly like to just demonstrate different ways of doing things where possible to build up that toolset in people's minds.