C 實現簡單打字小遊戲

2022-09-26 02:21:17 字數 2078 閱讀 5424

using system;

using system.collections.generic;

using system.componentmodel;

using system.data;

using system.edwfwamdrawing;

using system.linq;

using system.text;

using system.threading.tasks;

using system.windows.forms;

namespace 打字遊戲

random r = new random();

//遊戲區

panel gamearea = new panel();

//控制區

panel area = new panel();

//裝鳥的盒子

picturebox bird = new picturebox();

//字母出現定時器

timer zimu = new timer();

//飛鳥與字母下落定時器

timer fly = new timer();

//開edwfwam始/暫停按鈕

button button = new button();

//積分器

label scoring = new label();

//血條

label bar = new label();

//尾翼

picturebox wei = new picturebox();

picturebox weiyi = new picturebox();

//裝字母的盒子

list zmbox = new list();

private void form1_load(object sender, eventargs e)

//按鈕設定

private void button_click(object sender, eventargs e)

else if (button.text=="暫停")

}//飛機

picturebox plane = new picturebox();

//鍵盤事件

private void form1_keypress1(object sender, keypresseventargs e)}}

} //字母

private void zimu_tick(object sender, eventargs e)

}//**飛鳥動畫

int bo = 0;

//積分

int fen = 0;

int t = 0, y = 0;

private void fly_tick(object sender, eventargs e)

//遍歷控制項

foreach (control item in gamearea.controls)

}//字母下落

if (item.tag.tostring() == "zm"||item.tag.tostring()=="bj")

else}}

}//子彈上公升

if (item.tag.tostring() == "bullet")

//重新遍歷

foreach (control letter in gamearea.controls)}}

}//尾翼動畫**

wei.image = imagelist3.images[t];

t++;

if (t >= imagelist3.images.count)

weiyi.image = imagelist3.images[y];

y++;

if (y >= imagelist3.images.count) }}

private void zha_tick(object sender, eventargs e)

}//清屏字母

private void qingping()}}}

本文標題: c#實現簡單打字小遊戲

本文位址:

JS簡單打字小遊戲demo

打字遊戲 title style html,body main font fstyle head body div id main div body script varwords a b c d e f g h i j k l m n o p q r s t u v w x y z varwinw...

C 實現打字小遊戲(一)

先附上兩張截圖 這裡主要是針對c 計時器的使用 初始時間我們定為三分鐘這裡用label標籤來顯示英文本母 public void initlabel private char getlet 這樣就完成了標籤的初始化,然後使用計時器來控制降落速度 if let1.bottom this height ...

簡單的c語言實現打字小遊戲

執行效果 賬號密碼都是123 輸入賬號密碼後回車 進入遊戲 include include include include include include define crt secure no warnings using namespace std int now count 0 當前得分 d...