一步步教學生開發簡單遊戲 一

2021-04-27 16:52:13 字數 3127 閱讀 9886

//levelform.cs

using system;

using system.threading;

using system.collections.generic;

using system.componentmodel;

using system.data;

using system.text;

using system.io;

using system.windows.forms;

using system.drawing;

namespace mygame

private void levelform_load(object sender, eventargs e)

catch (exception ex)

}private void updateui()

private void btnmove_click(object sender, eventargs e)

private void btnreturn_click(object sender, eventargs e)

private void btnexit_click(object sender, eventargs e)

private void btnmonstermove_click(object sender, eventargs e)

private void btnmonsterreturn_click(object sender, eventargs e)}}

//turtlemonster.cs

using system;

using system.collections.generic;

using system.text;

using system.drawing;

namespace mygame

public turtlemonster(string name,image image, point originallocation, size size)

//怪物名字

private string monstername;

public string monstername

set

}//原始生命值

private int originalblood;

public int originalblood

set

}//攻擊力

private int attackpower;

public int attackpower

set

}//防禦力

private int defendpower;

public int defendpower

set

}//怪物的

private image image;

public image image

set

}//原始位置

private point originallocation;

public point originallocation

set

}//當前位置

private point currentlocation;

public point currentlocation

set

}// 大小

private size size;

public size size

set

}///

/// 怪物移動的方法

///

/// 移動到玩家

public void move(hero hero)

///

/// 回到原位置方法

///

public void move()}}

//hero.cs

using system;

using system.collections.generic;

using system.text;

using system.drawing;

namespace mygame

public hero(string name, int originalblood, int attackpower, int defendpower,

image image, point originallocation, size size)

//主角名字

private string heroname;

public string heroname

set

}//原始生命值

private int originalblood;

public int originalblood

set

}//攻擊力

private int attackpower;

public int attackpower

set

}//防禦力

private int defendpower;

public int defendpower

set

}//玩家的

private image image;

public image image

set

}//原始位置

private point originallocation;

public point originallocation

set

}//當前位置

private point currentlocation;

public point currentlocation

set

}// 大小

private size size;

public size size

set

}///

/// 移動到怪物的左下角

///

/// 玩家所移動到的怪物物件

public void move(turtlemonster monster)

///

/// 過載move方法  返回原始位置

///

public void move()}}

一步步學ROS

最近因為看svo的 裡面用到catkin決定要好好看ros,年前學會基本操作。啟動節點 rosrun package name executable name 檢視節點 rosnode list 注 rosout 節點是乙個特殊的節點,通過 roscore 自動啟動 檢視特定節點的資訊 rosnod...

windows Thrift c 一步步搭建

1.thrift 原始碼路徑 2.libevent原始碼路徑 3.boost路徑 安裝 conan install boost 1.68.0 conan stable 4.openssl路徑 安裝 conan install openssl 1.1.1a conan stable conan安裝bo...

一步步啟動linux

可以一步一步啟動linux.在ubantu剛一啟動時,按c健即進入grub 提示符狀態,在此狀態下輸入 我用的是ubuntu 13 grub linux vmlinuz grub ls boot grub initrd boot initrd.img 3.11.0 15 generic grub b...