飞行棋游戏的设计与实现(9)
时间:2026-01-20
时间:2026-01-20
9 Is_Fly() 判断棋子是否可以飞行
Private Function Is_Fly(Player_Idx As Long, Plan_Idx As Long) As Boolean '是否可以跳 跃
Is_Fly = False
If GmData.Plan(Player_Idx, Plan_Idx).Idx_Abs = 17 Then Is_Fly = True End If End Function
10 Is_Jump() 判断棋子是否可以跳跃
Private Function Is_Jump(Player_Idx As Long, Plan_Idx As Long) As Boolean '是否可以 跳跃
Is_Jump = False
If GmData.Plan(Player_Idx, Plan_Idx).Idx_Abs < GmData.Trn2Landing And GmData.Plan(Player_Idx, Plan_Idx).Idx_Abs Mod 4 = 1 Then
Is_Jump = True End If End Function
11 IS_Complete() 判断某玩家棋子是否全部胜利
Private Function IS_Complete(Player_Idx As Long, Plan_Idx As Long) As Boolean '是否 全部胜利
IS_Complete = False
If GmData.Plan(Player_Idx, Plan_Idx).Idx_Abs = 55 Then GmData.Plan(Player_Idx, Plan_Idx).Stat = Complete IS_Complete = True End If End Function
12 GetForwardTest() 判断棋子能否走到骰子所示的点数
指定棋子前面的 Range 范围内 安全则返回 Range,否则返回一个小于 Range 的整数。
13 CntFormation() 统计迭子数量
Player_Idx 在 Idx_Rlat 上有多少迭子,返回 1~4 之间的一个整数
Dim Plan As Long, T As Boolean CntFormation = 0 For Plan = 0 To 3
If GmData.Plan(Player_Idx, Plan).Stat = OnTheWay Then
If GmData.Plan(Player_Idx, Plan).Idx_Rlat = Idx_Rlat Then
CntFormation = CntFormation + 1 End If End If Next End Function
Private Function CntFormation(Player_Idx As Long, Idx_Rlat As Long) As Long
14 CntPlanStat()统计某玩家出于某种状态的棋子数量
下一篇:大学语文12——论快乐