在游戏设计中学c语言,C语言贪吃蛇游戏的设计与实现(国外英文资料).doc

C语言贪吃蛇游戏的设计与实现(国外英文资料)

C语言贪吃蛇游戏的设计与实现(国外英文资料)

It's a rule of thumb, and my game is no exception. In addition to the end of the game screen, I also set up a game screen, "finish". With the above divided, I divided the whole process into (13+2) modules (actually function) 2.2.3 program structure (Liu Chengtu) figure 2.1 flow chart according to the need to deal with the task requirements, planning input data and output results, determine the data structure of the data is stored. In C language, the data structure is concentrated in the data type, so in the C language programming, we should plan the variables, array, pointer, and their types in the program as a whole. This is important, and if you choose inappropriate variables or arrays during this period, it will be very difficult to modify them in the future. Now analyze the elements of the snake game, and then come up with their corresponding description in the program: Snake: Basic Description: length, color, position. The corresponding data and data types: length - although you can use the coordinates, but in this case, the computation will be great, so the conversion into larger units - the number of nodes, each section describes the fixed length integer coordinates; color; integer; position --X, Y coordinates. Added Description: the direction of snake movements, snake life. Corresponding data and data types: these descriptions are for the input part of the program's key and are linked to the end of the game. There are only four directions: up and down. You can set the corresponding four integer numbers: 3, 4, 2, 1. There are only two instances of life: death or birth, corresponding to 0 or 1. Food: Basic Description: color, position. The corresponding data and data types are no longer discussed because the colors are fixed. Location - X and Y coordinates. An added Description: the existence of food. The corresponding data and data types are set up to avoid repeated food, which is related to the function that draws the food. Only two v

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值