Android 上的 Pygame [英] Pygame on Android

查看:73
本文介绍了Android 上的 Pygame的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有人可以详细解释如何在 Android 手机上运行使用 Pygame 开发的游戏/应用程序.我最近完成了 PacMan 的编程,它在我的电脑上运行良好,但我认为如果我能在我的手机上运行它会很棒.我尝试按照 http://pygame.renpy.org/android-packaging 上的说明进行操作.html,但是每次我在 IDLE 上运行import android"时,我都会收到一条错误消息,说它没有找到该模块.有人可以清楚地解释如何设置android模块吗?

I was wondering if someone could give me a detailed explanation on how to run a game/app developed using Pygame on an Android phone. I recently finished programming PacMan and it works perfectly on my computer, but I think it would be awesome if I could get it running on my phone. I tried following the instructions at http://pygame.renpy.org/android-packaging.html, but every time i run "import android" on the IDLE I get an error saying it did not find the module. Could someone clearly explain how to set up the android module?

此外,在我的程序中,我使用了诸如 if (event.key == K_UP or event.key == K_w): direction = UP 之类的代码.但是手机上没有方向键.我需要使用什么代码来查看用户是否用手指从上 -> 下或左 -> 右等滑动屏幕.

Also, in my program I used code such as if (event.key == K_UP or event.key == K_w): direction = UP. However there are no arrow keys on a phone. What code would I need to use to see if the user swiped the screen with their fingers from up -> down or left -> right, etc.

任何帮助都会很棒.谢谢<3

Any help would be great. Thanks <3

推荐答案

有一个适用于 android 的 pyGame 子集.然而,这需要特殊的返工和更改程序.希望不会太难.

There is a pyGame subset for android. However this requires special reworking and changing the program. Hopefully it will not be to hard.

http://pygame.renpy.org/writing.html

http://pygame.renpy.org/index.html

但是关于你的第二个问题,我无法回答,因为我还没有足够的经验.

However about your second question i am unable to awnser because I am Not yet experienced enough.

这篇关于Android 上的 Pygame的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆