[怎样用VB编写打字小游戏]我2年前写的,有点幼稚。别见笑VERSION 5.00Begin VB.Form Form1 AutoRedraw = -1 'True Caption = "打字游戏 小游戏而已" ClientHeight = 4800 ClientLeft = 60 ClientTop = 7...+阅读
个简单的Flash打字游戏 上一篇 / 下一篇 2007-09-25 16:42:03 查看( 142 ) / 评论( 3 ) / 评分( 5 / 0 ) 代码: /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 打字游戏 ——V1.0 日期:2007-9-24 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 定义变量 ---------------------------------------------------------------------------------------------- */ fscommand("fullscreen", true); var Bring_num:Number = 0; var Bring_maxnum:Number = 20; var Grade_num:Number = 1; var Grade_bring:Number = 100; var Move_speed:Number = 2; var Bring_speed:Number = 0; var Press_num:Number = 0; var Right_num:Number = 0; var Loss_num:Number = 0; var Grade_boolean:Boolean = false; var Interval_num:Number = 0; var Listener:Object = new Object(); var Addsound:Sound = new Sound(); var Addblast_mc:Object = new Object(); var Time_m:Number = 0; var Time_s:Number = 1; var Hide_id:Number; /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Bring_word函数功能:随机产生字符 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% */ function Bring_word() { var color_array:Array = new Array(0xffffff, 0x9B4A8B, 0xE0C0DB, 0xAC285E, 0x235CB1, 0x379D37, 0xB1A323); var txtstyle:TextFormat = new TextFormat(); txtstyle.bold = true; txtstyle.font = "宋体"; txtstyle.size = 20; txtstyle.color = color_array[random(7)]; _root.Bring_num++; if (_root.Bring_num>=Bring_maxnum) { _root.Bring_num = 0; } switch (random(2)) { case 0 : txt = random(26)+97; break; case 1 : txt = random(10)+48; break; } _root.createTextField("txt"+_root.Bring_num, _root.Bring_num, random(Stage.width), -(random(200)+10), 25, 25); this["txt"+_root.Bring_num].text = chr(txt); this["txt"+_root.Bring_num].setTextFormat(txtstyle); } /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Interval_event();初始化时产生的字符个数 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% */ function Interval_event() { Bring_word(); Interval_num++; if (Interval_num>=3) { clearInterval(Interval_id); } } var Interval_id:Number = setInterval(Interval_event, 1000); /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% cyc_event下落函数 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% */ function cyc_event() { function _event() { for (var i = 0; iStage.height) { _root["txt"+i].removeTextField(); Bring_word(); Loss_num++; loss_txt.text = Loss_num; } } } var cyc_id:Number = setInterval(_event, 50); } cyc_event(); /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 监听键盘 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% */ Key.addListener(Listener); Listener.onKeyDown = function() { Press_num++; //trace(Press_num); if (Grade_boolean) { Grade_num++; Grade_boolean = false; grade_txt.text = "第"+Grade_num+"关"; Move_speed += 2; for (var i = 0; i
跪求flash as3 0游戏打地鼠的代码其他的flas游戏也可以发给我的
老鼠移动类:package { import flash.display.MovieClip; import flash.events.Event; import flash.events.EventDispatcher; public class MouseMove extends MovieClip { private var _mc:MovieClip; private var Y:Number; private var _distance:Number; private var directions:Number=-1; public function MouseMove(target:MovieClip,distance):void { _mc=target; Y=_mc.y; _distance=Y-distance; } public function startMove():void { _mc.addEventListener(Event.ENTER_FRAME,moves); } private function moves(e:Event):void { var mc:MovieClip=e.target as MovieClip; var dis:Number=Math.abs(mc.y-_distance)+0.2; mc.y+=dis/4*directions; if (mc.y directions=1; } else if (directions==1&mc.y>=Y) { mc.y=Y; directions=-1; mc.removeEventListener(Event.ENTER_FRAME,moves); mc.dispatchEvent(new Event("moveover")); } } } } 文档类 package { import flash.display.MovieClip; import flash.events.Event; import flash.events.MouseEvent; import flash.events.TimerEvent; import flash.utils.Timer; import flash.text.TextField; public class Documents extends MovieClip { private var num:uint; private var mc:MovieClip; private var score:uint; private var timer:Timer; private var time:uint; private var totalTimes:uint=60; private var clickState:Boolean; private var gameState:Boolean=true; private var button:AgainButton; public function Documents():void { stop(); score_txt.mouseEnabled=false; stage.frameRate=60; init(); } private function changes():void { if (gameState) { clickState=false; num=uint(Math.random()*18)+1; mc=this["mouse"+num+"_mc"].mc; var mousemove:MouseMove=new MouseMove(mc,80); mousemove.startMove(); mc.addEventListener("moveover",moveOver); mc.addEventListener(MouseEvent.CLICK,playAnimotion); mc.buttonMode=true; } else { timer.stop(); gameOver() } } private function moveOver(e:Event):void { mc.removeEventListener("moveover",moveOver); mc.removeEventListener(MouseEvent.CLICK,playAnimotion); mc.buttonMode=false; changes(); } private function playAnimotion(e:Event):void { if (clickState==false) { clickState=true; score++; score_txt.text=String(score); mc.play(); } } private function init():void { back.visible=false timer=new Timer(1000); timer.start(); timer.addEventListener(TimerEvent.TIMER,timerRecorder); time=0; score=0 score_txt.text=String(score); time_txt.text=String(time); button=new AgainButton(); changes(); } private function timerRecorder(e:TimerEvent):void { time++; time_txt.text=String(time); if (time>=60) { gameState=false; gotoAndStop(2); } } private function gameOver():void { addChild(button); back.visible=true button.x=stage.stageWidth/2; button.y=stage.stageHeight/2; button.addEventListener(MouseEvent.CLICK,reStart); } private function reStart(e:MouseEvent):void { gameState=true; removeChild(button); init() } } } 如果还有啥需要我这有源码 希望楼主采纳!
计算机专业的朋友们帮帮忙急需一份 VB打地鼠游戏程序代码
'窗口中就一个LABEL,名称:lblInfo'这个带有动画Option ExplicitDim lZQ As LongDim lCW As LongDim dStart As Double '开始时间Dim dStop As Double '停止时间Dim iNum As Integer '字数Dim lTime As Long 'Dim iTime As IntegerDim iCode As IntegerDim iScorce As Integer '分数Dim bOK As BooleanPrivate Sub Form_DblClick() '开始 Me.Timer1.Enabled = True dStart = TimeEnd SubPrivate Sub Form_Resize() Me.lblInfo.Top = Me.Height - 1000End SubPrivate Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) If dStart0 Then If KeyCode = iCode Or KeyCode = iCode - 32 Then' If iCode
以下为关联文档:
vb的打字小游戏用一个标签label1放字母添加一个计时器,设置时间为1000毫秒再添加一个全局变量,用来表明字母有没有打对再设一全局变量,用来计分再添加一个命令按钮,用来开始游戏dim flag%,scor...
怎样用VB做打字游戏??Dim t As Integer Dim s(1 To 5, 1 To 5) As String '用二维数组s()来存放打字数据 Dim n As Integer Dim r As Integer Private Sub Command1_Click() If t = 0 Then MsgBox...
求一款vb打字游戏Dim m As IntegerDim n As IntegerPrivate Sub Form_KeyPress(KeyAscii As Integer)If KeyAscii = 13 ThenTimer1.Interval = 100ElseFor j = 0 To 9If Label1(j).Caption =...
急求VB课程设计代码课题是打字游戏!我也是网上下下来自己学习用的 '开始打字 Private Sub start_type_Click() '读如句子 ScaleMode = 3 '以象素为单位 If deforescrapname <> scrapname Then '同一篇不能显示...
如何编写vb拼音打字游戏加10个label1控件组,一个timer,操作:运行后,回车即可进行游戏,代码:Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As IntegerDim m As IntegerPri...
vb编写打字游戏的源代码11月11日 00:46 1、 Dim n As Integer, s As Integer n = InputBox("请输入一个偶数n") s = 0 Do While n >= 2 s = s + ((n - 1) * 10 + 2) - (n * 10 + 2) n = n - 2 Loop Msg...
求一个练习打字速度的小游戏要求画面精致!小老鼠接奶酪 丛林历险记3 俄罗斯方框 巨弓守城 双人打棒球 星星岛 水钻宫主 制做比萨 生死时速 CS反恐狙击手 我的高中生活 美丽高中生 勇闯神秘洞穴 扑克斗地主 花式撞球...
求下用FLASH做一个简单的打地鼠的游戏的具体步骤准备美术素材, 鼠洞,鼠进洞动画,出洞动画, 打鼠的锤子 把 鼠洞,鼠进洞动画,出洞动画 ,这些组合到一个MovieClip,然后复制几个(假如是10个)放到舞台上,取好名mc0~mc9 写程序, (1)用打鼠的锤...
有哪些单机游戏不用打字的单机游戏排行榜 1 魔兽争霸3——冰封王座 2 暗黑破坏神2——毁灭之王 3 三国志9,10,11 4 幻想三国志1,2 5 轩辕剑3——天之痕 6 仙剑奇侠传 7 新绝代双骄3 8 曹操传 9 刀剑...