简体   繁体   English

记录游戏 object 运动使用 C# 和 windows 形式

[英]record game object movement use C# and windows form

I have made a game use windows form ( C# programming) with 3 levels, I need to know how can I record the game movement??我做了一个游戏使用windows表格(C#编程)3个关卡,我想知道如何记录游戏动作?? that allowed click button show how the player was played????允许点击按钮显示播放器的播放方式????

A common approach is to store all actions either in memory and on disk.一种常见的方法是将所有操作存储在 memory 和磁盘上。 For turn based or step like games (like card games or so) this can be achievable by having a action list defined up front and use that as input for your game controls.对于基于回合或类似步骤的游戏(如纸牌游戏等),这可以通过预先定义一个动作列表并将其用作游戏控件的输入来实现。

In short this will result in a pattern like:简而言之,这将导致如下模式:

UX Action -> Game Action -> Execute Game Action

eg:例如:

Arrow button press -> Translate to move instruction -> Apply move

This allows you also for easy playback.这也使您可以轻松播放。 The UX action can be a click on a cell, or using your arrow keys etc. UX 操作可以是单击单元格,或使用箭头键等。

If you have a more complex game, like Race games, first person shooters, things become a bit harder - you'll also need to store the exact time and duration of each game action.如果你有一个更复杂的游戏,比如竞速游戏、第一人称射击游戏,事情就会变得有点困难——你还需要存储每个游戏动作的确切时间和持续时间。

These are the basics - If you want to know more, you'll need to be more specific.这些是基础知识 - 如果您想了解更多,您需要更具体。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM