Chase Game in Silverlight 1.0
Another brief experiment in Silverlight 1.0: this time a simple game. Originally I wanted to have an object that the player would drag around, but apparently Silverlight 1.0 does not have a hittest method for objects. It does in the next version… As the instructions say, keep your mouse pointer away from the wall and the bouncing box… If you do touch anything, the wall you touched or the box itself will highlight with red. My next experiment will be in Silverlight 2.0, because it is quite a bit different and I don’t want to fall behind… [note color=”FFFFCC”] [/note] javascript code var mouseX = 0; var mouseY = 0; var moveX = 0.0; var moveY = 0.0; var X = 170; var Y = 10; //------------------------------ var canvas = null; var plugin = null; var ball; var txtTicks; var lineLeft; var lineTop; var lineRight; var lineBottom; //------------------------------ var gravity = 0.1; var interval; var seconds=0; var ticks=0; function onCanvasLoaded(sender) { plugin = sender.getHost(); txtTicks = sender.findname("txtTicks"); lineLeft =...
Read More