布局 - 初学android,想做一个中国象棋的项目练一下手
阿神
阿神 2017-04-17 13:02:43
0
2
490

今天做过一个猜数字的游戏,很快做完了,布局简单,逻辑也并不是很复杂。
但是要着手做一个象棋游戏,就不太清楚该从何下手。
先不谈人工智能方面,首先从布局上来看,就觉得挺复杂的。然后将象棋的这些规则融入进去,比如哪些能够走动,哪些不能走动,也觉得挺复杂的。

想请教一下高手们如果让你们从0开始写一个android版本的象棋,你需要走哪些步骤?

阿神
阿神

闭关修行中......

reply all(2)
刘奇

First of all, we must grasp a principle, the graphical interface and logic must be separated. There is nothing much to say about the graphical interface, let’s talk about the logic part. Write classes for chess pieces and abstract the characteristics of each chess piece, such as name, color, footwork, position, etc. It is also necessary to define a file format that describes the chessboard state for storage, reading, writing, and transmission. This can also be directly found in standard file formats, such as sgf. Also write a parser for this file format. Once you have these basic things written down, consider the next step.
Let’s also talk about the graphical interface. Don't pursue the realization of the entire chessboard in one step. To do it in layers, first write a control that can display pictures and zoom in and out, then extend it to vertical and horizontal lines, and then extend it to chess pieces that can be placed at intersections, etc., and implement it step by step. Loading the chessboard screen relies on The parser is loaded from a file. The graphical interface is only responsible for display and does not assume any logical functions.

The most important thing when writing software is to have a sense of hierarchy, not to be impatient, and to write layer by layer.

洪涛

Abstract modeling of chess pieces is the most difficult

It is relatively simple to implement a graphical interface

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!