在python中创建游戏的边界! [英] Boundaries in creating a game in python!
本文介绍了在python中创建游戏的边界!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是python我正在创建2D游戏.
这是一种迷宫游戏,具有不同形状的墙壁.
当我一刻与墙壁碰撞时,用户可以穿过墙壁,但我希望能够阻止他这样做.我希望他们坚强!
我该怎么做呢?我会使用数组吗?我之前在另一场游戏中已经创建了一个外墙,但这只是在用户类中设置边界.必须有一种简单的方法来使用大量的墙壁.
帮助越多越好.
Im python I am creating a 2d game.
It is a maze game with different shapes of walls.
When I collide with the walls at the minute the user can go through them but I want to be able to block him from doing that. I want them to be solid!
How do i do this? Would i use an array? I have created an outside wall before in another game but that was just setting the bounds in the user class. There has to be an easier way with a number amount of walls.
The more help the better thanks.
推荐答案
我们将其称为"碰撞检测 [ ^ ].
We call it "Collision Detection[^]".
这篇关于在python中创建游戏的边界!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文