IT方面。谁有C#的俄罗斯方块代码,要实现连网对战功能/事成后追加200-400分。

来源:百度知道 编辑:UC知道 时间:2024/06/30 03:20:09
大家帮帮忙。事成之后我将追加二百分。若不够还可以商量。重要是要用C#实现的。并且还要能实现网络对战功能。谢谢,

代码有~但是你自己理解去
(这只是一部分~楼主真的需要的话百度hi我~我直接把整个项目给你)
using System;
using System.Windows.Forms;
using System.Drawing;
using System.Drawing.Drawing2D;

class MainForm :Form
{
void keypressed(Object o, KeyPressEventArgs e)
{

if(e.KeyChar=='j') tp.moveLeft();
if(e.KeyChar=='l') tp.moveRight();
if(e.KeyChar=='i') tp.rotate();
if(e.KeyChar=='k') tp.drop();
if(e.KeyChar=='r')tp.start(1);
e.Handled=true;
}

TetPanel tp = new TetPanel();
void onresize(object sender, EventArgs e)
{
tp.Size=ClientSize;
tp.setPens();
tp.Refresh();
}
public MainForm()
{
Text = "Tetris";
tp.KeyPress += new KeyPressEventHandler(keypressed);
Resize+=new EventHandler(onresize);
//SetStyle(ControlStyles.SupportsTransparentBackColor,true);
//SetStyle(ControlStyles.AllPainti