Add-ons › Widgets › Miscellaneous

Sabiland's Escapist

by sabisan ·

Full randomized colorful widget with many runners catching the escaping runner.

Description

At each start (or if you hit F5 for refresh) following happens: 1) 2-40 runners are generated randomly 2) Starting sizes are selected randomly and are the same for all the starting runners 3) From time to time a single runner is randomly selected (with a different color) and in the same time all the other runners are trying to catch him 4) Runner who touches him first gets bigger a little bit - but escapist becomes smaller a little bit 5) When no escapist is currently selected all the runners are moving randomly 6) All the runners are always trying to avoid the closest neighbours (but not escapist of course - remember, they want to catch him) 7) All the graphics is drawn to HTML 5 Canvas element Cheers ! :-)

Screenshots

Sabiland's Escapist

Comments (6 on the original page, latest shown)

  • sabisanNov 17, 2009
    Just an info. about the movement-logic, if anyone is intereseted :-) 1) Every little move for each of the runners (including escapist) has a a lot of randomness in it. 2) For each runner there is defined one Point P starting with (0,0) coordinates at the beginning. This means, runner is at full stop. Now, let's say, we draw an imaginary circle around that point, say, with radius == 5. This means, that runner can later change his Rx/Ry position for MAX 5 pixels at the time (timer-tick). If there is NO escapist selected, all I do is just to move this point randomly INSIDE this imaginary circle and then just add/subtract current (Px,Py) values to the current runner's (Rx, Ry) position. The distance between (0,0) and (Px,Py) is (of course) the speed. Remember, we never move (Rx,Ry) directly. We are always moving ONLY (Px,Py) and in the end just adding/subtracting these values to/from (Rx,Ry) - which are the main runner-center coordinates.
  • sabisanNov 17, 2009
    3) Flow for runner (not escapist) movement-logic is: - check for borders (if there WAS a hit, just multiply Px or Py (or both of course) with -1) - find the CLOSEST runner (not escapist) - if the closest runner is TOO close - try to avoid it in a (these-two-runners-current-angle + Pi +/- random offset angle). - if there is escapist selected, try to catch him - if there is no escapist selected, do a random movement 4) Escapist: - tries to avoid borders in a way that if escapist is TOO close, he tries to go back to somewhere in the middle of the "screen". - check if maybe there was a border-hit. - find a closest runner. If he is TOO close, try to avoid it, if not, do the random-escape. 5) All in all it's really very simple movement-logic. Most random decisions are decided via Math.random() > 0.5 ? doThis: -doThis.
  • tinhoyNov 17, 2009
    Very cool and works smoothly too. BTW, does the displayed size of the runner have and effect on the imaginary radius used to determine speed? I can see many different scenarios possible. For example, many times the chases are too short. Maybe a tweak to runner logic. Have the runner that catches escapist become the new escapist. When there is a new escapist, runners all go into a state of Avoidance, then Randomness, before reverting back to Chase. This should give the Escapist more time to escape. Change in states could be determined individually via random(), allowing multiple types of runners to exist at once. Because of the Closest runner avoidance logic, it'd be interesting to see what happens when runners having different goals.
  • sabisanNov 18, 2009
    Yo! Yeah, currently the imaginary raidus to determine the max. speed is always the same for all. Thx for your suggestions. I agree, it would be interesting to see what happens when muliple types of runners exist at the same time. I'm already working on some extra just-eye-candy improvements. But I think it's worth to try to tweak some logic/parameters with the ideas you've suggested. When I'll be finished, I'll probably upload it as a new widget - not as an upgrade.
  • sabisanDec 1, 2009
    I'm almost finished with Escapist Deluxe version. I decided to publish it (in a few days) as a new widget. New stuff that will come with Deluxe version: - More than 1 escapist at the same time - Higher movement speeds - Randomly choosen screen-painting version + with many different drawing-presets. Really interesting drawings can happen
  • LaptopuriJan 15, 2010
    Great miscellaneous widget, nice work!

Download

This file has not been recovered yet. Do you have a copy? Tell us.

About this widget

Downloads1,583
CategoryMiscellaneous
Version1.0
Size27KB
Last updateNovember 13, 2009
Devicesdesktop, tv
Original pageInternet Archive