简体   繁体   English

如何阻止图像移动两次?

[英]How to stop Image from moving twice?

I am trying to learn the google app inventor software. 我正在尝试学习Google App Inventor软件。 I know that these questions aren't answered here, but the question is not about the software but the code. 我知道这里没有回答这些问题,但是问题不是关于软件而是代码。 Since this is block code I can't link the code, but what I am looking for is a way to solve my problem. 由于这是块代码,因此无法链接代码,但是我正在寻找解决问题的方法。

Question: 题:

I am playing around with they're tutorials to learn the software a bit. 我正在和他们一起学习一些软件的教程。 In the tutorial you are making a whack-a-mole game. 在本教程中,您正在制作一个小游戏。 The mole is on a timer(1000 milliseconds) to move the mole to a different location. 痣在计时器(1000毫秒)上,以将痣移动到另一个位置。 When you touch the mole it also moves to a different location. 当您触摸痣时,它也会移动到其他位置。 When I touch the mole sometimes it will jump to another location, register the hit, and then move again. 当我触摸痣时,有时它将跳到另一个位置,记录击中点,然​​后再次移动。 I have my code set to register the hit before it moves( i checked it several times). 我将代码设置为在命中之前记录命中(我检查了几次)。 I believe my problem comes from the 1 second timer not resetting when the mole it clicked registering two move methods. 我相信我的问题来自于1秒计时器未重置,当它单击的痣登记了两种移动方法时。

Is there way to either reset the timer when touched or the check for touch when timer is up or any other ideas? 有没有办法在触摸定时器时重置定时器,或者在定时器启动时重置触摸或其他任何想法? (I don't think either of these will solve my problem) (我认为这些方法都不能解决我的问题)

When I touch the mole sometimes it will jump to another location, register the hit, and then move again 当我触摸痣时,有时它将跳到另一个位置,记录下击中点,然​​后再次移动

as the tutorial originally was designed, this could happen, but in the revised version this was corrected and the mole moves only in the Clock1.Timer event. 正如本教程最初设计的那样,这可能发生,但是在修订版本中,此问题已得到纠正,并且痣仅在Clock1.Timer事件中移动。

屏幕截图

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

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