亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? 移動(dòng)方塊的小游戲源代碼.txt

?? 一個(gè)java小游戲
?? TXT
字號(hào):
using System; 
using System.Windows; 
using System.Windows.Controls; 
using System.Windows.Input; 
using System.Windows.Media; 
using System.Windows.Shapes; 
using System.Windows.Threading; 

namespace Escapa 
{ 
public partial class Page : UserControl 
{ 
private Rectangle blackRect = new Rectangle(); 
private Rectangle whiteRect = new Rectangle(); 
private Rectangle blueRect1 = new Rectangle(); 
private Rectangle blueRect2 = new Rectangle(); 
private Rectangle blueRect3 = new Rectangle(); 
private Rectangle blueRect4 = new Rectangle(); 
private Rectangle redRect = new Rectangle(); 
private TextBlock readme = new TextBlock(); 

private DispatcherTimer timer = new DispatcherTimer(); 
private DateTime startTime; 

private void defaultValue() 
{ 
this.blackRect.Height = 452; this.blackRect.Width = 452; 
this.blackRect.SetValue(Canvas.LeftProperty, 0.0); 
this.blackRect.SetValue(Canvas.TopProperty, 0.0); 
this.blackRect.Fill = new SolidColorBrush(Color.FromArgb(0xFF, 0, 0, 0)); 

this.whiteRect.Height = 349; this.whiteRect.Width = 349; 
this.whiteRect.SetValue(Canvas.LeftProperty, 46.0); 
this.whiteRect.SetValue(Canvas.TopProperty, 46.0); 
this.whiteRect.Fill = new SolidColorBrush(Color.FromArgb(0xFF, 0xFF, 0xFF, 0xFF)); 
this.whiteRect.HorizontalAlignment = HorizontalAlignment.Center; 
this.VerticalAlignment = VerticalAlignment.Center; 

this.blueRect1.Height = 62; 
this.blueRect1.Width = 62; 
this.blueRect1.SetValue(Canvas.LeftProperty, 68.0); 
this.blueRect1.SetValue(Canvas.TopProperty, 66.0); 
this.blueRect1.Fill = new SolidColorBrush(Color.FromArgb(0xFF, 0x0F, 0x6F, 0xFF)); 

this.blueRect2.Height = 52; 
this.blueRect2.Width = 62; 
this.blueRect2.SetValue(Canvas.LeftProperty, 268.0); 
this.blueRect2.SetValue(Canvas.TopProperty, 56.0); 
this.blueRect2.Fill = new SolidColorBrush(Color.FromArgb(0xFF, 0x0F, 0x6F, 0xFF)); 

this.blueRect3.Height = 62; 
this.blueRect3.Width = 32; 
this.blueRect3.SetValue(Canvas.LeftProperty, 68.0); 
this.blueRect3.SetValue(Canvas.TopProperty, 316.0); 
this.blueRect3.Fill = new SolidColorBrush(Color.FromArgb(0xFF, 0x0F, 0x6F, 0xFF)); 

this.blueRect4.Height = 22; 
this.blueRect4.Width = 98; 
this.blueRect4.SetValue(Canvas.LeftProperty, 298.0); 
this.blueRect4.SetValue(Canvas.TopProperty, 326.0); 
this.blueRect4.Fill = new SolidColorBrush(Color.FromArgb(0xFF, 0x0F, 0x6F, 0xFF)); 

this.blueRect4.Height = 22; 
this.blueRect4.Width = 98; 
this.blueRect4.SetValue(Canvas.LeftProperty, 298.0); 
this.blueRect4.SetValue(Canvas.TopProperty, 326.0); 
this.blueRect4.Fill = new SolidColorBrush(Color.FromArgb(0xFF, 0x0F, 0x6F, 0xFF)); 

this.redRect.Height = 41; 
this.redRect.Width = 41; 
this.redRect.SetValue(Canvas.LeftProperty, 204.0); 
this.redRect.SetValue(Canvas.TopProperty, 202.0); 
this.redRect.Fill = new SolidColorBrush(Color.FromArgb(0xFF, 0xFF, 0, 0)); 

this.xs = 3.0; //默認(rèn)橫移動(dòng)速度 
this.ys = 2.0; //默認(rèn)豎移動(dòng)速度 
} 

/// <summary>一橫一豎線是否相交</summary> 
/// <param name="hx1">橫線左</param> 
/// <param name="hx2">橫線右</param> 
/// <param name="hy">橫線y</param> 
/// <param name="vy1">豎線高</param> 
/// <param name="vy2">豎線低</param> 
/// <param name="vx">豎線x</param> 
/// <returns></returns> 
private bool IsLineCross(double hx1, double hx2, double hy, double vy1, double vy2, double vx) 
{ 
return (vy1 < hy) && (vy2 > hy) && (hx1 < vx) && (hx2 > vx); 
} 
private bool IsRectCross(Rectangle r1, Rectangle r2) 
{ 
double x11 = (double)r1.GetValue(Canvas.LeftProperty); 
double y11 = (double)r1.GetValue(Canvas.TopProperty); 
double x12 = x11 + r1.Width; 
double y12 = y11 + r1.Height; 

double x21 = (double)r2.GetValue(Canvas.LeftProperty); 
double y21 = (double)r2.GetValue(Canvas.TopProperty); 
double x22 = x21 + r2.Width; 
double y22 = y21 + r2.Height; 

return 
IsLineCross(x11, x12, y11, y21, y22, x21) //橫上 豎左 
|| IsLineCross(x11, x12, y11, y21, y22, x22) //橫上 豎右 
|| IsLineCross(x11, x12, y12, y21, y22, x21) //橫下 豎左 
|| IsLineCross(x11, x12, y12, y21, y22, x22) //橫下 豎右 

|| IsLineCross(x21, x22, y21, y11, y12, x11) //橫上 豎左 
|| IsLineCross(x21, x22, y21, y11, y12, x12) //橫上 豎右 
|| IsLineCross(x21, x22, y22, y11, y12, x11) //橫下 豎左 
|| IsLineCross(x21, x22, y22, y11, y12, x12) //橫下 豎右 
; 
} 

public Page() 
{ 
InitializeComponent(); 

Canvas canvas = new Canvas(); 
this.LayoutRoot.Children.Add(canvas); 
canvas.Children.Add(this.blackRect); 
canvas.Children.Add(this.whiteRect); 
canvas.Children.Add(this.blueRect1); 
canvas.Children.Add(this.blueRect2); 
canvas.Children.Add(this.blueRect3); 
canvas.Children.Add(this.blueRect4); 
canvas.Children.Add(this.redRect); 

canvas.Children.Add(readme); 
readme.Foreground = new SolidColorBrush(Color.FromArgb(255, 255, 100, 180)); 
readme.FontSize = 20; 
readme.Text = "在白色范圍內(nèi)移動(dòng)紅色方塊,避免碰到藍(lán)色方塊"; 

this.defaultValue(); 

this.timer.Interval = new TimeSpan(0, 0, 0, 0, 1); 
this.timer.Tick += new EventHandler(timer_Tick); 

this.redRect.MouseLeftButtonDown += new MouseButtonEventHandler(redRect_MouseLeftButtonDown); 
this.redRect.MouseMove += new MouseEventHandler(redRect_MouseMove); 
this.redRect.MouseLeftButtonUp += new MouseButtonEventHandler(redRect_MouseLeftButtonUp); 
} 

private void CheckFinish() 
{ 
//判斷出白界 
double redx = (double)this.redRect.GetValue(Canvas.LeftProperty); 
double redy = (double)this.redRect.GetValue(Canvas.TopProperty); 
double whitex = (double)this.whiteRect.GetValue(Canvas.LeftProperty); 
double whitey = (double)this.whiteRect.GetValue(Canvas.TopProperty); 
//判斷紅藍(lán)碰撞 
if (redx < whitex || redx + this.redRect.Width > whitex + this.whiteRect.Width) this.Finish(); 
if (redy < whitey || redy + this.redRect.Height > whitey + this.whiteRect.Height) this.Finish(); 
if ( 
IsRectCross(this.redRect, this.blueRect1) || 
IsRectCross(this.redRect, this.blueRect2) || 
IsRectCross(this.redRect, this.blueRect3) || 
IsRectCross(this.redRect, this.blueRect4) 
) 
{ 
this.Finish(); 
} 
} 
private void Finish() 
{ 
this.isMouseDown = false; 
this.redRect.ReleaseMouseCapture(); 
MessageBox.Show(string.Format("{0}秒", (DateTime.Now - this.startTime).TotalSeconds)); 
this.timer.Stop(); 
this.readme.Visibility = Visibility.Visible; 
this.defaultValue(); 
} 

//4個(gè)藍(lán)色方塊的移動(dòng)方向 
private int fx1 = 1; private int fy1 = 1; 
private int fx2 = -1; private int fy2 = 1; 
private int fx3 = 1; private int fy3 = -1; 
private int fx4 = -1; private int fy4 = -1; 
private double xs; 
private double ys; 
void timer_Tick(object sender, EventArgs e) 
{ 
double v1x = (double)this.blueRect1.GetValue(Canvas.LeftProperty); 
double v1y = (double)this.blueRect1.GetValue(Canvas.TopProperty); 
double v2x = (double)this.blueRect2.GetValue(Canvas.LeftProperty); 
double v2y = (double)this.blueRect2.GetValue(Canvas.TopProperty); 
double v3x = (double)this.blueRect3.GetValue(Canvas.LeftProperty); 
double v3y = (double)this.blueRect3.GetValue(Canvas.TopProperty); 
double v4x = (double)this.blueRect4.GetValue(Canvas.LeftProperty); 
double v4y = (double)this.blueRect4.GetValue(Canvas.TopProperty); 

v1x += xs * fx1; v1y += ys * fy1; 
v2x += xs * fx2; v2y += ys * fy2; 
v3x += xs * fx3; v3y += ys * fy3; 
v4x += xs * fx4; v4y += ys * fy4; 

if (v1x < 0 || v1x > this.blackRect.Width - this.blueRect1.Width) fx1 *= -1; 
if (v1y < 0 || v1y > this.blackRect.Height - this.blueRect1.Height) fy1 *= -1; 
if (v2x < 0 || v2x > this.blackRect.Width - this.blueRect2.Width) fx2 *= -1; 
if (v2y < 0 || v2y > this.blackRect.Height - this.blueRect2.Height) fy2 *= -1; 
if (v3x < 0 || v3x > this.blackRect.Width - this.blueRect3.Width) fx3 *= -1; 
if (v3y < 0 || v3y > this.blackRect.Height - this.blueRect3.Height) fy3 *= -1; 
if (v4x < 0 || v4x > this.blackRect.Width - this.blueRect4.Width) fx4 *= -1; 
if (v4y < 0 || v4y > this.blackRect.Height - this.blueRect4.Height) fy4 *= -1; 

this.blueRect1.SetValue(Canvas.LeftProperty, v1x); 
this.blueRect1.SetValue(Canvas.TopProperty, v1y); 
this.blueRect2.SetValue(Canvas.LeftProperty, v2x); 
this.blueRect2.SetValue(Canvas.TopProperty, v2y); 
this.blueRect3.SetValue(Canvas.LeftProperty, v3x); 
this.blueRect3.SetValue(Canvas.TopProperty, v3y); 
this.blueRect4.SetValue(Canvas.LeftProperty, v4x); 
this.blueRect4.SetValue(Canvas.TopProperty, v4y); 

//每次速度提升1/1000 
this.xs *= 1.001; 
this.ys *= 1.001; 

this.CheckFinish(); 
} 

private double beginX; 
private double beginY; 
private bool isMouseDown; 
void redRect_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) 
{ 
this.beginX = e.GetPosition(null).X; 
this.beginY = e.GetPosition(null).Y; 
this.isMouseDown = true; 
((UIElement)sender).CaptureMouse(); 
if (this.timer.IsEnabled == false) 
{ 
this.timer.Start(); //開始移動(dòng) 
this.readme.Visibility = Visibility.Collapsed; 
this.startTime = DateTime.Now; 
} 
} 
void redRect_MouseMove(object sender, MouseEventArgs e) 
{ 
if (isMouseDown == true) 
{ 
double currX = e.GetPosition(null).X; 
double currY = e.GetPosition(null).Y; 
double currLeft = (double)((UIElement)sender).GetValue(Canvas.LeftProperty); 
double currTop = (double)((UIElement)sender).GetValue(Canvas.TopProperty); 
((UIElement)sender).SetValue(Canvas.LeftProperty, currLeft + currX - beginX); 
((UIElement)sender).SetValue(Canvas.TopProperty, currTop + currY - beginY); 
this.beginX = currX; 
this.beginY = currY; 
} 
} 
void redRect_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) 
{ 
this.isMouseDown = false; 
((UIElement)sender).ReleaseMouseCapture(); 
} 

} 

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美年轻男男videosbes| 高清在线观看日韩| 欧美色爱综合网| 午夜成人免费视频| 欧美一个色资源| 麻豆高清免费国产一区| 久久久不卡网国产精品一区| 成人综合在线观看| 亚洲裸体在线观看| 欧美亚洲禁片免费| 日本不卡视频一二三区| 精品国产1区2区3区| 成人性视频网站| 亚洲综合成人网| 日韩精品一区二区在线| 国产91精品久久久久久久网曝门| 国产精品久久久久久户外露出| 91久久精品一区二区三区| 无码av中文一区二区三区桃花岛| www一区二区| 91猫先生在线| 另类小说欧美激情| 日韩美女啊v在线免费观看| 欧洲精品一区二区三区在线观看| 精品午夜一区二区三区在线观看| 欧美韩国一区二区| 欧美日韩在线播放| 国产成人高清视频| 亚洲在线视频网站| 久久久亚洲午夜电影| 欧美亚洲国产一区二区三区| 国内精品久久久久影院一蜜桃| 国产精品成人在线观看| 欧美本精品男人aⅴ天堂| 99re成人在线| 国产一区二区精品久久91| 亚洲一区二区不卡免费| 国产精品欧美综合在线| 91精品国产高清一区二区三区| 波多野结衣91| 韩日精品视频一区| 亚洲一区影音先锋| 国产精品麻豆99久久久久久| 日韩三级视频中文字幕| 在线看国产一区| 国产丶欧美丶日本不卡视频| 视频精品一区二区| 亚洲欧美在线另类| 精品福利二区三区| 欧美电影在线免费观看| av亚洲精华国产精华精华| 久久国产精品色婷婷| 亚洲第一搞黄网站| 亚洲黄色在线视频| 国产精品网站导航| 国产亚洲一区二区三区四区| 日韩欧美国产小视频| 宅男噜噜噜66一区二区66| 在线观看免费一区| 色婷婷综合久久| 97se亚洲国产综合自在线| 国产成人av一区| 国产一区二区不卡| 久久er99精品| 九色|91porny| 久久精品理论片| 蜜臀精品久久久久久蜜臀| 香蕉久久一区二区不卡无毒影院 | 自拍偷拍国产亚洲| 久久精品视频免费| 久久综合九色欧美综合狠狠| 日韩一区和二区| 日韩欧美123| 亚洲精品一区二区三区香蕉| 欧美一区二区三区免费大片| 91精品国产色综合久久不卡蜜臀| 欧美精品色综合| 欧美肥妇free| 91精品国产91久久久久久一区二区| 欧美亚洲国产bt| 欧美日韩国产综合一区二区| 欧美日本高清视频在线观看| 欧美一区二区三区免费大片| 日韩一卡二卡三卡国产欧美| 精品久久久久久综合日本欧美| 久久亚洲精品国产精品紫薇| 国产视频911| 亚洲免费在线视频一区 二区| 亚洲美女视频在线观看| 亚洲一区二区高清| 日韩一区欧美二区| 久久99国产精品成人| 国产激情视频一区二区在线观看 | 一区二区三区在线观看欧美| 夜夜嗨av一区二区三区| 亚洲国产精品一区二区久久 | 久久亚洲一区二区三区明星换脸| 久久久久国产精品麻豆ai换脸| 国产精品理论片在线观看| 亚洲欧美日韩一区二区三区在线观看 | 亚洲成人激情社区| 免费看日韩a级影片| 激情六月婷婷综合| 粉嫩绯色av一区二区在线观看| 色呦呦国产精品| 欧美一区二区三区婷婷月色 | 中文字幕一区日韩精品欧美| 亚洲高清视频在线| 开心九九激情九九欧美日韩精美视频电影 | 久久亚洲春色中文字幕久久久| 国产精品丝袜91| 午夜精品免费在线观看| 国内精品国产三级国产a久久| 99久久精品免费精品国产| 欧美日本韩国一区| 国产亚洲婷婷免费| 亚洲二区在线视频| 国产一区 二区| 在线免费观看视频一区| 精品噜噜噜噜久久久久久久久试看 | 亚洲蜜臀av乱码久久精品| 亚洲成人av一区二区三区| 国产精品亚洲人在线观看| 色婷婷亚洲精品| 久久精品免费在线观看| 三级久久三级久久| 成人午夜激情片| 欧美一区二区三区日韩视频| 成人欧美一区二区三区在线播放| 午夜精品成人在线| 99久久免费视频.com| 日韩欧美你懂的| 亚洲综合成人在线视频| 丁香一区二区三区| 91精品国产色综合久久ai换脸| 国产精品乱码久久久久久| 麻豆精品视频在线| 欧美主播一区二区三区| 国产精品久久毛片| 黑人精品欧美一区二区蜜桃| 欧美日韩mp4| 亚洲欧美日韩在线不卡| 成人午夜在线免费| 亚洲精品一区二区三区精华液| 午夜亚洲国产au精品一区二区| jlzzjlzz国产精品久久| 久久在线观看免费| 免费高清视频精品| 欧美影视一区在线| 亚洲男帅同性gay1069| 成人免费看的视频| 久久精品夜色噜噜亚洲a∨| 日本免费新一区视频| 欧美午夜精品久久久久久孕妇| 亚洲日本韩国一区| 北条麻妃一区二区三区| 国产婷婷一区二区| 国产精品一二三四| 精品88久久久久88久久久| 蜜桃av噜噜一区| 日韩欧美国产电影| 麻豆精品一区二区综合av| 日韩一级黄色大片| 免费成人在线观看视频| 欧美一级欧美一级在线播放| 日韩电影免费在线看| 91精品国产综合久久福利软件 | 欧美自拍偷拍一区| 亚洲黄色尤物视频| 欧美在线|欧美| 亚洲国产精品影院| 欧美电影一区二区三区| 天堂蜜桃一区二区三区 | 在线看不卡av| 亚洲一区二区三区激情| 欧美日韩一级二级| 日韩精品国产精品| 欧美mv日韩mv国产网站app| 久久99久久久欧美国产| 精品久久久久久综合日本欧美| 国产一区91精品张津瑜| 中文字幕精品综合| av亚洲产国偷v产偷v自拍| 亚洲图片你懂的| 欧美性极品少妇| 青青草国产精品亚洲专区无| 精品美女在线播放| 成人深夜在线观看| 亚洲免费观看在线视频| 91.麻豆视频| 国内精品伊人久久久久av一坑 | 一区二区视频免费在线观看| 欧美性受极品xxxx喷水| 美女mm1313爽爽久久久蜜臀| 国产婷婷色一区二区三区四区 | 亚洲欧美日韩国产综合| 欧美日本在线播放| 国产一区二区三区日韩| 亚洲欧美日韩国产成人精品影院 | 日韩欧美在线1卡|