Skip to content

Latest commit

 

History

History
38 lines (34 loc) · 933 Bytes

16_lasers.md

File metadata and controls

38 lines (34 loc) · 933 Bytes

someone328 chameleon way

	// using canvas to draw the line
        var ctx = map.getCanvasContext();
        ctx.beginPath();
        ctx.strokeStyle = color; //make lasers colored
        ctx.lineWidth = 5;
        ctx.moveTo(x1, y1);
        ctx.lineTo(x2, y2);
        ctx.stroke();
		
		//color switcher by telephone
		player.setColor('red');
		player.setPhoneCallback(function(){
    	var color = player.getColor();
        switch(color)
        {
        	case 'red':
            	player.setColor('yellow');
                break;
            case 'yellow':
            	player.setColor('teal');
                break;
            case 'teal':
            	player.setColor('red');
                break;
        }
    });

Jhack (giacgbj)

Nothing in the first area.

The following code in the second area:

getRandomInt = function(){return 600;};