Alright, I've got a game that I've been overhauling recently to make it wii friendly...

original game:
http://ian.janasnyder.com/valo.htm

wii beta:
http://ian.janasnyder.com/valoWii.htm

Right now, my problem is collision detection, I've got a system for wii which I think is faster, but less accurate.

The code I'm using for the wii version has shown profuse problems with collision detection, I'm not sure how you would run this kind of thing efficiently for this type of game, does anyone have any pointers?
Code:
function bleh() {
	y3 = int(_ymouse/30);
	x3 = int(_xmouse/30);
	y1 = _ymouse;
	x1 = _xmouse;
	if (y3 > y2) {
		n = y2;
		n2 = y3;
	} else {
		n = y3;
		n2 = y2;
	}
	yd = y1 - y0;
	xd = x1 - x0;
	m = yd/xd;
	b = y3 - m*x3;
	for (n; n <= n2; n++) {
		n1 = (n - b)/m
		q = _root["myMap"+game.currentMap][n][n1];
		select = "t_"+n+"_"+n1;
		atile = _root.tiles[_root.select]
		if (drawn == 1) {
			if (q == 1) {
				atile.gotoAndStop(3);
			}
			if (q == 2) {
				atile.gotoAndStop(6);
			}
			if (q == 3) {
				atile.gotoAndStop(8);
			}
			if (q == 7) {
				atile.gotoAndStop(11);
			}
			if (q == 8) {
				atile.gotoAndStop(13);
			}
		}
	}
	y2 = int(_ymouse/30);
	x2 = int(_xmouse/30);
	y0 = _ymouse;
	x0 = _xmouse;
}
I get the slope between the last mouse position and the current, and then run a for loop to see what tiles hit that line. Any suggestions?


btw, the tile numerical values are:
blue = 1
red = 2
green = 3
enemy = 5
yellow = 7
purple = 8