简体   繁体   English

使用加速度计移动球Windows Phone 8

[英]Moving a ball with accelerometer Windows Phone 8

I'm learning for windows phone 8, and i wanted to write an app where i can move an image using the accelerometer, not a level detector, i want it to move just like in labyrinth games. 我正在为Windows Phone 8学习,我想编写一个应用程序,在其中我可以使用加速度计而不是电平检测器来移动图像,我希望它可以像迷宫游戏一样移动。 How would i make this happen? 我将如何做到这一点? Does anyone have any good samples/turials/explainations or similar? 有没有人有任何好的样品/纪念品/说明或类似的东西? I have been searching the web for two days now, trying to be integrating it. 我已经在网上搜索了两天,试图进行整合。 It will be used for a very simple learning-game for myself since i learn alot from samples. 因为我从样本中学到了很多东西,所以它将用于我自己的一个非常简单的学习游戏。 I have started my project as a normal app, since this is what i absolutely like to develop with, the UI design, etc, i have already created a basic UI, and also things the ball can collide into, things like arcs and stuff(controls). 我已经从一个普通的应用程序开始了我的项目,因为这是我绝对喜欢开发的,UI设计等,我已经创建了一个基本的UI,并且球可以碰撞到的东西,例如弧线和东西(控件)。 I am writing it in C#, i also got a little knowledge from java game development (not very much). 我用C#编写它,我也从Java游戏开发中获得了一些知识(不是很多)。

Thanks alot! 非常感谢!

There aren't any samples (AFAIK) that do exactly what you describe. 没有任何样本(AFAIK)能够完全满足您的描述。

If you really want an accelerometer/labyrinth game, there's a C++ sample at http://code.msdn.microsoft.com/wpapps/Marble-Maze-sample-for-c9f3706b 如果您真的想要加速度计/迷宫游戏,请访问http://code.msdn.microsoft.com/wpapps/Marble-Maze-sample-for-c9f3706b ,这里有一个C ++示例

Alternatively, there a lot of other samples to learn from. 另外,还有许多其他示例可供学习。
These should keep you busy for a while: http://code.msdn.microsoft.com/wpapps/ 这些应该使您忙一阵子: http : //code.msdn.microsoft.com/wpapps/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM