# The concept behind Stringy Flash game: determine if a Sprite is inside a lasso

Do you remember my Flash game called Stringy?

I blogged about it about a month ago and some people asked me some hints about the way used to catch the stars drawing a lasso around it.

There are a lot of mathematical formulas to solve this task, and range from “more than complicate” to “you must be joking”.

I decided to post a prototype of the code I used starting from the post Develop a Flash game like String Avoider – AS3 version – and more!, without any comment, and it will be up to you to guess how I solved the problem in a ridiculously easy way.

This is what you will get:

Catch the circle with a lasso to make it move in a random spot.

And this is the code:

```package {
import flash.display.Sprite;
import flash.events.Event;
import flash.geom.Point;
public class Main extends Sprite {
private var tailLenght:Number=1;
private var tailNodes:Number=300;
private var tailCanvas:Sprite=new Sprite();
private var areaCanvas:Sprite=new Sprite();
private var targetCanvas:Sprite=new Sprite();
private var nodes:Vector.=new Vector.();
private var target:Point;
public function Main() {
for (var i:int=0; i=new Vector.();
tailCanvas.graphics.clear();
tailCanvas.graphics.lineStyle(3,0x00ff00);
tailCanvas.graphics.moveTo(mouseX,mouseY);
areaCanvas.graphics.clear();
nodes[0]=new Point(mouseX,mouseY);
sampleNodes[0]=new Point(mouseX,mouseY);
for (var i:int=1; isegment1Len) {
return null;
}
if (Math.pow(p2.x-px,2)+Math.pow(p2.y-py,2)>segment1Len) {
return null;
}
if (Math.pow(p3.x-px,2)+Math.pow(p3.y-py,2)>segment2Len) {
return null;
}
if (Math.pow(p4.x-px,2)+Math.pow(p4.y-py,2)>segment2Len) {
return null;
}
return new Point(px,py);
}
}
}```

No need to download anything, you can replace the code contained in the original prototype with this one.

Did you figure out how I made it possible with no formulas?

215 GAME PROTOTYPES EXPLAINED WITH SOURCE CODE
// 1+2=3
// 10000000
// 2 Cars
// 2048
// Avoider
// Ballz
// Block it
// Blockage
// Bloons
// Boids
// Bombuzal
// Breakout
// Bricks
// Columns
// CubesOut
// Dots
// DROP'd
// Dudeski
// Eskiv
// Filler
// Fling
// Globe
// HookPod
// Hundreds
// InkTd
// Iromeku
// Lumines
// Magick
// MagOrMin
// Maze
// Memdot
// Nano War
// Nodes
// o:anquan
// Ononmin
// Pacco
// Phyballs
// Platform
// Poker
// Pool
// Poux
// Pudi
// qomp
// Racing
// Renju
// SameGame
// Security
// Sling
// Slingy
// Sokoban
// Splitter
// Sproing
// Stack
// Stairs
// Stringy
// Sudoku
// Tetris
// Threes
// Toony
// Turn
// TwinSpin
// vvvvvv
// Wordle
// Worms
// Yanga
// Zhed
// zNumbers