虽然飘姐姐说。。这些都可以由显卡来解决。。但是还是觉得好帅。。可爱的作者~~~
package{
import flash.display.Sprite;
import flash.text.TextField;
import flash.events.MouseEvent;
import ascb.util.NumberUtilities;
public class NumbersAndMath extends Sprite{
var _die:Sprite;
var _value:uint;
public function NumbersAndMath( ){
_die= new Sprite( );
addChild(_die);
_die.addEventListener(MouseEvent.CLICK,rollDie);
rollDie(null);
}
private function rollDie(event:MouseEvent):void {
_value=NumberUtilities.random(1, 6);
_die.graphics.clear( );
_die.graphics.lineStyle( );
_die.graphics.beginFill(0xFFFFFF);
_die.graphics.drawRect(0,0,50,50);
_die.graphics.endFill( );
_die.graphics.beginFill(0x000000);
if(_value==1|| _value== 3|| _value== 5){
_die.graphics.drawCircle(25,25,4);
}
if(_value==2|| _value== 3|| _value== 4|| _value ==5 || _value== 6)
{
_die.graphics.drawCircle(11,11, 4);
_die.graphics.drawCircle(39,39,4);
}
if(_value==4|| _value== 5|| _value== 6){
_die.graphics.drawCircle(11,39,4);
_die.graphics.drawCircle(39,11, 4);
}
if(_value==6){
_die.graphics.drawCircle(11,25,4);
_die.graphics.drawCircle(39,25,4);
}
}
}
}
posted on 2008-10-27 22:07
正牌的天地之灵和他的徒儿们肖赫_王婷婷_王冠_郑燚_孙婷 阅读(196)
评论(0) 编辑 收藏 引用 所属分类:
糖糖