1
this is a game I am creating called: "Click the apple" its in dutch btw上的图片快速点击
IM编程新手,所以我做这个游戏,但我想补充一些grafics和IM试图在Photoshop中的东西,这就是我想出了,我很喜欢它现在的问题,当我把一个点击事件的picutebox(苹果),我让它增加一个标签,每次我点击它只是工作正常,但是当我点击快速它不能跟上(我也用一个快速的咔嗒声,但它只是慢慢递增)当我做同样的事情,但用一个按钮,它的工作就好了现在我想知道最新的问题,也许你们有些人可以帮助我,虐待粘贴在这里的代码:
Public Class Form1
Dim appels As Integer = 0
Dim aps As Integer = 0
Dim apc As Integer = 10
Dim ug_1_multiplier As Integer = 2
Dim ug_1_prijs As Integer = 1500
Dim appelstruik_prijs As Integer = 100
Dim appelstruik_aps As Integer = 1
Dim appelstruik_aantal As Integer = 0
Dim appelstruik_max As Integer = 20
Dim appelboom_prijs As Integer = 200
Dim appelboom_aps As Integer = 5
Dim appelboom_aantal As Integer = 0
Dim appelboom_max As Integer = 10
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
L_appelstruiken_prijs.Text = appelstruik_prijs
L_aant_appelstruiken.Text = (appelstruik_aantal & "/" & appelstruik_max)
L_appelbomen_prijs.Text = appelboom_prijs
L_aant_appelbomen.Text = (appelboom_aantal & "/" & appelboom_max)
T_aps.Start()
T_testformax.Start()
End Sub
Private Sub PictureBox2_Click(sender As Object, e As EventArgs) Handles PictureBox2.Click
PictureBox2.Enabled = False
PictureBox2.Enabled = True
appels = appels + apc
L_aant_appels.Text = appels
End Sub
Private Sub B_appelstruik_kopen_Click(sender As Object, e As EventArgs) Handles B_appelstruik_kopen.Click
If appels >= appelstruik_prijs Then
aps = aps + appelstruik_aps
appels = appels - appelstruik_prijs
appelstruik_prijs = Math.Round(Val(appelstruik_prijs/10), 0) + appelstruik_prijs
appelstruik_aantal += 1
L_aant_appelstruiken.Text = (appelstruik_aantal & "/" & appelstruik_max)
L_appelstruiken_prijs.Text = appelstruik_prijs
L_aps.Text = aps
L_aant_appels.Text = appels
Else
MessageBox.Show("je hebt: " & appels & " van de: " & appelstruik_prijs)
End If
End Sub
Private Sub B_appelboom_kopen_Click(sender As Object, e As EventArgs) Handles B_appelboom_kopen.Click
If appels >= appelboom_prijs Then
aps = aps + appelboom_aps
appels = appels - appelboom_prijs
appelboom_prijs = Math.Round(Val(appelboom_prijs/10), 0) + appelboom_prijs
appelboom_aantal += 1
L_aant_appelbomen.Text = (appelboom_aantal & "/" & appelboom_max)
L_appelbomen_prijs.Text = appelboom_prijs
L_aps.Text = aps
L_aant_appels.Text = appels
Else
MessageBox.Show("je hebt: " & appels & " van de: " & appelboom_prijs)
End If
End Sub
Private Sub T_aps_Tick(sender As Object, e As EventArgs) Handles T_aps.Tick
appels = appels + aps
L_aant_appels.Text = appels
L_aant_appelstruiken.Text = (appelstruik_aantal & "/" & appelstruik_max)
L_appelstruiken_prijs.Text = appelstruik_prijs
L_appelbomen_prijs.Text = appelboom_prijs
L_aant_appelbomen.Text = (appelboom_aantal & "/" & appelboom_max)
L_aps.Text = aps
L_aant_appels.Text = appels
End Sub
Private Sub T_testformax_Tick(sender As Object, e As EventArgs) Handles T_testformax.Tick
If appelstruik_aantal >= appelstruik_max Then
B_appelstruik_kopen.Enabled = False
Else
B_appelstruik_kopen.Enabled = True
End If
If appelboom_aantal >= appelboom_max Then
B_appelboom_kopen.Enabled = False
Else
B_appelboom_kopen.Enabled = True
End If
End Sub
Private Sub B_gen_appels_Click(sender As Object, e As EventArgs) Handles B_gen_appels.Click
appels = appels + apc
L_aant_appels.Text = appels
End Sub
Private Sub b_upgrade_1_apc_dubbel_Click(sender As Object, e As EventArgs) Handles b_upgrade_1_apc_dubbel.Click
If appels >= ug_1_prijs Then
apc = apc * ug_1_multiplier
L_apc.Text = apc
b_upgrade_1_apc_dubbel.Enabled = False
Else
MessageBox.Show("je hebt: " & appels & " van de: " & ug_1_prijs)
End If
End Sub
End Class
我不知道你是否使用visual studio,但是当你在设计视图和dubbleklick的东西时,你会得到如下代码:http://pastebin.com/KNBg8t0h,我对picturebox做了同样的事情,但是它增加了较慢(相对于我点击的速度) –
当你意识到在控制中双击时,你会得到类似图像的代码。但是,这只是控制的默认事件。在屏幕上方你会看到两个列表。一会写“点击”。将其更改为“MouseClick”。一个新的子将显示。 – Daniel1791
我将它更改为“MouseClick”,但它做了同样的事情,后来我将它更改为“MouseDown”并且问题得到解决,谢谢我感谢您的帮助。对不起,我的英文不好,:P哈哈 –