Visual Basic Forum

Visual Basic Forum
für VB6 und VB.NET Programmierer
 
RegistrierenRegistrieren  LoginLogin
Neues Thema eröffnen   Neue Antwort erstellen    Visual Basic Forum Foren-Übersicht -> [VB6] Fragen - Antworten
Autor
Nachricht
PokemonProgrammierer
Newbie
Newbie

Anmeldedatum: 23.07.2010
Beiträge: 14

Animierte Gegner
Verfasst am: 21.09.2010, 16:57

Liebe Programmieren der Sprache von Vb,
wiedereinmal bitte ich um eure gnädige Hilfe.

Ich habe folgendes Problem.
Ein Gegner bewegt sich von Links nach Rechts, aber nur solange es Picture18(0) oder (1) enspricht. Wenn der Gegner .Left
an einer bestimmten ist wird des Bild zu 18(2) gewchstelt. Diese Abfragen finden in einem Timer mit dem Inteval 1 statt:
S
Code:

'Hünchen Rupfen
Dim Gegner As Integer
For Gegner = 0 To Bod11
If Picture19(Gegner).Picture = Picture18(0).Picture Then Picture19(Gegner).Left = Picture19(Gegner).Left + 20
If Picture19(Gegner).Picture = Picture18(1).Picture Then Picture19(Gegner).Left = Picture19(Gegner).Left + 20
If Picture19(Gegner).Picture = Picture18(2).Picture Then Picture19(Gegner).Left = Picture19(Gegner).Left - 20
If Picture19(Gegner).Picture = Picture18(3).Picture Then Picture19(Gegner).Left = Picture19(Gegner).Left - 20
If Picture19(Gegner).Left > 9480 Then Picture19(Gegner).Picture = Picture18(2).Picture
If Picture19(Gegner).Left > -500 Then Picture19(Gegner).Picture = Picture18(0).Picture
Next


Außerdem Gibt es einen zweiten Timer mit dem Inteval 200:


Code:

Dim Gegner1 As Integer
For Gegner1 = 0 To Bod11
If Picture19(Gegner1).Picture = Picture18(0).Picture Then
Picture19(Gegner1).Picture = Picture18(1).Picture
Exit Sub
End If
If Picture19(Gegner1).Picture = Picture18(1).Picture Then
Picture19(Gegner1).Picture = Picture18(0).Picture
Exit Sub
End If
If Picture19(Gegner1).Picture = Picture18(2).Picture Then
Picture19(Gegner1).Picture = Picture18(3).Picture
Exit Sub
End If
If Picture19(Gegner1).Picture = Picture18(3).Picture Then
Picture19(Gegner1).Picture = Picture18(2).Picture
Exit Sub
End If
Next


Nun mein Problem: Die Figur geht einfach immer und immer weiter nach Links
Danke für all Anworten Very Happy
Nein danke, ich kaufe nichts!
 
christopher.g
Überflieger
Überflieger

Anmeldedatum: 03.05.2008
Beiträge: 565


Verfasst am: 22.09.2010, 08:35

hi
ich hab jetzt kein vb6 da um das zu testen
aber was mir aufgefallen ist...

Code:
If Picture19(Gegner).Left > 9480 Then Picture19(Gegner).Picture = Picture18(2).Picture
If Picture19(Gegner).Left > -500 Then Picture19(Gegner).Picture = Picture18(0).Picture


wenn jetzt pic19.left großer als 9480 ist
dann ist die zahl auch größer als - 500 Wink
klar oder
und somit ist pic19.picture immer pic18(0).pic

Code:
If Picture19(Gegner).Left => 9480 Then Picture19(Gegner).Picture = Picture18(2).Picture
If Picture19(Gegner).Left > -500 and Picture19(Gegner).Left < 9480 Then Picture19(Gegner).Picture = Picture18(0).Picture


wie gesagt getestet ist es nicht
da ich kein vb6 da hab
aber vl bringt es dich weiter
sonst is mir nix aufgefallen
 
PokemonProgrammierer
Newbie
Newbie

Anmeldedatum: 23.07.2010
Beiträge: 14

Re: Animierte Gegner
Verfasst am: 22.09.2010, 18:35

Danke es hat funktioniert. Warum bin ich nicht darauf gekommen? Aber es geht noch weiter denn wenn mehrere Gener
exitieren wird nur einer animiert:

Code:

Private Sub Timer2_Timer()
Dim Gegner1 As Integer
Dim Ch1 As Integer
Dim Ch2 As Integer
Dim Ch3 As Integer
Dim Ch4 As Integer

For Gegner1 = 0 To Bod11

If Picture19(Gegner1).Picture = Picture18(0).Picture Then
Picture19(Gegner1).Picture = Picture18(1).Picture
If Gegner1 = Bod11 Then GoTo ende
End If
 
  If Picture19(Gegner1).Picture = Picture18(1).Picture Then
Picture19(Gegner1).Picture = Picture18(0).Picture
 If Gegner1 = Bod11 Then GoTo ende
End If

 If Picture19(Gegner1).Picture = Picture18(2).Picture Then
Picture19(Gegner1).Picture = Picture18(3).Picture
If Gegner1 = Bod11 Then GoTo ende
End If

  If Picture19(Gegner1).Picture = Picture18(3).Picture Then
Picture19(Gegner1).Picture = Picture18(2).Picture
If Gegner1 = Bod11 Then GoTo ende
End If




Next
ende:
End Sub


Ich weiß echt nicht weiter Crying or Very sad
Ich habs schon untergeornete For - Schleifen probiert aber dann kam immer "Next ohne For" und wenn ich sie dann hin
gemacht habe kamm "For ohne Next"... Embarassed

Danke für alle Anwörtchen!
Nein danke, ich kaufe nichts!
 
christopher.g
Überflieger
Überflieger

Anmeldedatum: 03.05.2008
Beiträge: 565


Verfasst am: 23.09.2010, 10:17

hi
ja gerne...

so zum nächsten problem
timer2 nehm ich an macht aus dem bewegten bild eine "gehbewegung" oder?!
mit dem ständigen bild wechsteln

aber flimmert dass denn nicht?!



egal
lass doch mal überall "if gegner1 = bod11 then goto ende" weg
weil wenn die schleife im timer2 (int 200) durchläuft
wird der ganze vorgang (also bilder wechseln) nach dem ersten bild abgebrochen (wegen goto ende)

und die letzten 3 if abfragen werden nicht ausgeführt


mal schauen obs dann funktioniert

und for ohne next ist deswegen
weil du wahrscheinlich vorher kein endif hast

probiers mal
lg
 
PokemonProgrammierer
Newbie
Newbie

Anmeldedatum: 23.07.2010
Beiträge: 14

It works!
Verfasst am: 23.09.2010, 15:31

Danke hatt wiedereinmal funktioniert sieht jetzt so aus
Code:

Dim Gegner1 As Integer
Dim Ch1 As Integer
Dim Ch2 As Integer
Dim Ch3 As Integer
Dim Ch4 As Integer
For Gegner1 = 0 To Bod11
If Picture19(Gegner1).Picture = Picture18(0).Picture Then GoTo 1
If Picture19(Gegner1).Picture = Picture18(1).Picture Then GoTo 2
If Picture19(Gegner1).Picture = Picture18(2).Picture Then GoTo 3
If Picture19(Gegner1).Picture = Picture18(3).Picture Then GoTo 4
Next

1:
For Ch1 = 0 To Bod11
If Picture19(Ch1).Picture = Picture18(0).Picture Then
Picture19(Ch1).Picture = Picture18(1).Picture
End If
Next
GoTo ende
2:
For Ch2 = 0 To Bod11
If Picture19(Ch2).Picture = Picture18(1).Picture Then
Picture19(Ch2).Picture = Picture18(0).Picture
End If
Next
GoTo ende

3:
For Ch3 = 0 To Bod11
If Picture19(Ch3).Picture = Picture18(2).Picture Then
Picture19(Ch3).Picture = Picture18(3).Picture
End If
Next
GoTo ende

4:
For Ch4 = 0 To Bod11
If Picture19(Ch4).Picture = Picture18(3).Picture Then
Picture19(Ch4).Picture = Picture18(2).Picture
End If
Next
ende:




Beide Vögel fliegen jetzt einwandfrei Smile
Nein danke, ich kaufe nichts!
 
christopher.g
Überflieger
Überflieger

Anmeldedatum: 03.05.2008
Beiträge: 565


Verfasst am: 23.09.2010, 16:00

na und wann postest du dein prog???
kann mir da drunter ja überhaupt nichts vorstellen
 
PokemonProgrammierer
Newbie
Newbie

Anmeldedatum: 23.07.2010
Beiträge: 14

Später...
Verfasst am: 23.09.2010, 18:39

Ja, hab mir schon überlegt das zu Posten wenns fertig ist. Habs schon mal versucht mit dem "Verpackungs und Weitergabe
Assistent" zu Packen hatte aber 70 (!) MB Very Happy


Das ganze ist ein Level Editor das ich meinem Manic Miner Spiel beilegen will. Damit kann man einfach per Button
Steuerelemte vervielfältigen und sie per Mouse Move belibig auf dem Bildschirm platzieren kann.
Zb: Gegner, Sich nach links Bewegende Plattform, Sich nach Oben Bewegende Plattform, Giftige Planze...

Später kann man alles in .ini speichern und im Game Mode Spielen mit Springen, Fallen ...


Hoffe das kann dir was helfen.


Nein danke, ich kaufe nichts!
 
christopher.g
Überflieger
Überflieger

Anmeldedatum: 03.05.2008
Beiträge: 565


Verfasst am: 24.09.2010, 07:24

aha
naja nicht schlecht ^^
 
PokemonProgrammierer
Newbie
Newbie

Anmeldedatum: 23.07.2010
Beiträge: 14

Danke
Verfasst am: 25.09.2010, 20:30

Danke, find auch das es mir gelungen ist. Hab jetzt auch angefangen die eigentlichen Levels für das Spiel zu basteln.
Aber da kamm auch das nächste Problem:
Während des Spiels läuft ein Timer der die Restliche Zeit anzeigt. Sobald aber dann die Zweite Level geladen wird,
Code:
 Form5.Show

läuft die Zeit DOPPELT so schnell und wenn sie dan einmal voll ist fängt sie wieder bei 0 an anstatt den GameOver Screen zu laden.
Wenn allerdings Level2 das Startformular ist funktionierts einwandfrei. Hab schon folgendes probiert:
Code:
Form4.Zeit.Enabled = False

Danke, falls mir jemand helfen kann Laughing
Nein danke, ich kaufe nichts!
 
christopher.g
Überflieger
Überflieger

Anmeldedatum: 03.05.2008
Beiträge: 565


Verfasst am: 27.09.2010, 13:26

ja müsstest ein stück code aus diesem bereich zeigen
vl sieht mans dann

aber sonst könnt ich nix sagen was da los ist
 
PokemonProgrammierer
Newbie
Newbie

Anmeldedatum: 23.07.2010
Beiträge: 14


Verfasst am: 27.09.2010, 17:50

Ok dann geb ich dir mal den gesamten code meines Projektes.

Code:

Private Sub Form_Load()
'Form4.Zeit.Enabled = False
zeit1 = 0
zeit2 = 0
WindowsMediaPlayer1.URL = (App.Path + "\Music.wav")
Label4.Caption = 0
Bod1 = 3
'Leben.Value = 100
KeystoWin = 0
Leben.Value = Form4.Leben.Value
'Label4.Caption = Form4.Label4.Caption
'Label1.Caption = KeystoWin
links = 0
rechts = 0
z = 40 'Fallen
ff = FreeFile
zeit2 = 0
Open (App.Path + "\Save3.ini") For Input As #ff
Input #ff, Bod1
Input #ff, Bod2
Input #ff, Bod3
Input #ff, Bod4
Input #ff, Bod5
Input #ff, Bod6
Input #ff, Bod7
Input #ff, Bod8
Input #ff, Bod9
Input #ff, Bod10
Input #ff, Bod11
Input #ff, sfs: Picture5.Left = sfs
Input #ff, sfs: Picture5.Top = sfs
Input #ff, sfs: Picture9(0).Left = sfs
Input #ff, sfs: Picture9(0).Top = sfs
Input #ff, sfs: Picture9(1).Left = sfs
Input #ff, sfs: Picture9(1).Top = sfs
Input #ff, sfs: Picture9(2).Left = sfs
Input #ff, sfs: Picture9(2).Top = sfs
Input #ff, sfs: Picture9(3).Left = sfs
Input #ff, sfs: Picture9(3).Top = sfs
Input #ff, sfs: Picture9(4).Left = sfs
Input #ff, sfs: Picture9(4).Top = sfs
Input #ff, sfs: Picture11(0).Left = sfs
Input #ff, sfs: Picture11(0).Top = sfs
For S1 = 0 To Bod1 'Böden
If Bod1 > 3 Then Call CMD1
Input #ff, sfs: Picture2(S1).Left = sfs
Input #ff, sfs: Picture2(S1).Top = sfs
Next
For S2 = 0 To Bod2 'Pflanzen
If Bod2 > 0 Then Call CMD2
Input #ff, sfs: Picture4(S2).Left = sfs
Input #ff, sfs: Picture4(S2).Top = sfs
Next
For S3 = 0 To Bod3 'Eis
If Bod1 > 0 Then Call CMD3
Input #ff, sfs: Picture3(S3).Left = sfs
Input #ff, sfs: Picture3(S3).Top = sfs
Next
For S4 = 0 To Bod4
If Bod1 > 0 Then Call CMD4
Input #ff, sfs: Picture10(S4).Left = sfs
Input #ff, sfs: Picture10(S4).Top = sfs
Next
For S5 = 0 To Bod5
If Bod1 > 0 Then Call CMD5
Input #ff, sfs: Picture8(S5).Left = sfs
Input #ff, sfs: Picture8(S5).Top = sfs
Next
For S6 = 0 To Bod6
If Bod1 > 0 Then Call CMD6
Input #ff, sfs: Picture13(S6).Left = sfs
Input #ff, sfs: Picture13(S6).Top = sfs
Next
For S7 = 0 To Bod7
If Bod7 > 0 Then Call CMD7
Input #ff, sfs: Picture14(S7).Left = sfs
Input #ff, sfs: Picture14(S7).Top = sfs
Next
For S8 = 0 To Bod8
If Bod8 > 0 Then Call CMD8
Input #ff, sfs: Picture15(S8).Left = sfs
Input #ff, sfs: Picture15(S8).Top = sfs
Next
For S9 = 0 To Bod9
If Bod9 > 0 Then Call CMD9
Input #ff, sfs: Picture16(S9).Left = sfs
Input #ff, sfs: Picture16(S9).Top = sfs
Next
For S10 = 0 To Bod10
If Bod10 > 0 Then Call CMD10
Input #ff, sfs: Picture17(S10).Left = sfs
Input #ff, sfs: Picture17(S10).Top = sfs
Next
For S11 = 0 To Bod11
If Bod11 > 0 Then Call CMD11
Input #ff, sfs: Picture19(S11).Left = sfs
Input #ff, sfs: Picture19(S11).Top = sfs
Picture19(S11).Picture = Picture18(0).Picture
Next
Input #ff, sfs: zeit1 = sfs
Input #ff, sfs: punkte = sfs
Close ff
End Sub

Sub CMD1()
Load Picture2(Picture2.UBound + 1)
With Picture2(Picture2.UBound)
  .Top = Picture2(Picture2.UBound - 1).Top + .Height
  .Visible = True
End With
End Sub

Sub CMD2()
Load Picture4(Picture4.UBound + 1)
With Picture4(Picture4.UBound)
  .Top = Picture4(Picture4.UBound - 1).Top + .Height
  .Visible = True
End With
End Sub

Sub CMD3()
Load Picture3(Picture3.UBound + 1)
With Picture3(Picture3.UBound)
  .Top = Picture3(Picture3.UBound - 1).Top + .Height
  .Visible = True
End With
End Sub

Sub CMD4()
Load Picture10(Picture10.UBound + 1)
With Picture10(Picture10.UBound)
  .Top = Picture10(Picture10.UBound - 1).Top + .Height
  .Visible = True
End With
End Sub

Sub CMD5()
Load Picture8(Picture8.UBound + 1)
With Picture8(Picture8.UBound)
  .Top = Picture8(Picture8.UBound - 1).Top + .Height
  .Visible = True
End With
End Sub
Sub CMD6()
Load Picture13(Picture13.UBound + 1)
With Picture13(Picture13.UBound)
  .Top = Picture13(Picture13.UBound - 1).Top + .Height
  .Visible = True
End With
End Sub
Sub CMD7()
Load Picture14(Picture14.UBound + 1)
With Picture14(Picture14.UBound)
  .Top = Picture14(Picture14.UBound - 1).Top + .Height
  .Visible = True
End With
End Sub
Sub CMD8()
Load Picture15(Picture15.UBound + 1)
With Picture15(Picture15.UBound)
  .Top = Picture15(Picture15.UBound - 1).Top + .Height
  .Visible = True
End With
End Sub
Sub CMD9()
Load Picture16(Picture16.UBound + 1)
With Picture16(Picture16.UBound)
  .Top = Picture16(Picture16.UBound - 1).Top + .Height
  .Visible = True
End With
End Sub
Sub CMD10()
Load Picture17(Picture17.UBound + 1)
With Picture17(Picture17.UBound)
  .Top = Picture17(Picture17.UBound - 1).Top + .Height
  .Visible = True
End With
End Sub
Sub CMD11()
Load Picture19(Picture19.UBound + 1)
With Picture19(Picture19.UBound)
  .Top = Picture19(Picture19.UBound - 1).Top + .Height
  .Visible = True
End With
End Sub
Private Sub Fall_Timer()
Fall1 = Fall1 + z 'Fallhöhe 3080 ist normal
Picture5.Top = Picture5.Top + z 'FALLEN
End Sub

Private Sub Gift_Timer()
Leben.Value = Leben.Value - 1
End Sub

Private Sub Jump_Timer()
If Fly = 1 Then Fall.Enabled = True
If Fly = 1 Then Exit Sub
z = 0 ' Fallen
JumbBar1.Value = JumbBar1.Value + 1
Picture5.Top = Picture5.Top - 20
If JumbBar1.Value = 38 Then z = 40 ' Fallen
If JumbBar1.Value = 38 Then Fall.Enabled = True 'Fallen
If JumbBar1.Value = 38 Then Jump.Enabled = False
If JumbBar1.Value = 38 Then JumbBar1.Value = 0
End Sub
Private Sub Picture5_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 38 Then Jump.Enabled = True
If KeyCode = 32 Then Jump.Enabled = True
If KeyCode = 38 Then Fly = 1
If KeyCode = 32 Then Fly = 1
If KeyCode = 27 Then Form3.Show
If KeyCode = 40 Then Picture5.Top = Picture5.Top + 40
X = Picture5.Top
Dim wo1 As Long
Dim wo2 As Long
If KeyCode = 39 Then Picture5.Left = Picture5.Left + 40
If KeyCode = 39 Then wo1 = 1
If KeyCode = 39 Then wo2 = 0
If KeyCode = 37 Then Picture5.Left = Picture5.Left - 40
If KeyCode = 37 Then wo1 = 0
If KeyCode = 37 Then wo2 = 1
If KeyCode = 39 Then rechts = rechts + 1
If KeyCode = 37 Then links = links + 1
Call Bildchange(wo1, wo2)
End Sub
Sub Bildchange(wo1, wo2)
If wo1 = 1 Then GoTo r:
If wo2 = 1 Then GoTo l:
r:
If rechts = 1 Then Picture5.Picture = Picture6(0).Picture
If rechts = 5 Then Picture5.Picture = Picture6(1).Picture
If rechts = 13 Then Picture5.Picture = Picture6(2).Picture
If rechts = 9 Then Picture5.Picture = Picture6(0).Picture
If rechts = 17 Then rechts = 0
GoTo genug
l:
If links = 1 Then Picture5.Picture = Picture6(4).Picture
If links = 5 Then Picture5.Picture = Picture6(5).Picture
If links = 13 Then Picture5.Picture = Picture6(6).Picture
If links = 9 Then Picture5.Picture = Picture6(4).Picture
If links = 17 Then links = 0
GoTo genug:
genug:
End Sub
Private Sub Timer1_Timer() 'LOSER
Picture5.SetFocus

Dim tod2 As Integer
For tod2 = 0 To Bod6
treffer = 0
    If Picture5.Left > Picture13(tod2).Left And (Picture5.Left < Picture13(tod2).Left + Picture13(tod2).Width) And Picture5.Top > Picture13(tod2).Top And Picture5.Top < (Picture13(tod2).Top + Picture13(tod2).Height) Then treffer = 1
    If (Picture5.Left + Picture5.Width) > Picture13(tod2).Left And (Picture5.Left < Picture13(tod2).Left + Picture13(tod2).Width) And (Picture5.Top + Picture5.Height) > Picture13(tod2).Top And (Picture5.Top + Picture5.Height) < (Picture13(tod2).Top + Picture13(tod2).Height) Then treffer = 1
    If Picture5.Left > Picture13(tod2).Left And (Picture5.Left < Picture13(tod2).Left + Picture13(tod2).Width) And (Picture5.Top + Picture5.Height) > Picture13(tod2).Top And (Picture5.Top + Picture5.Height) < (Picture13(tod2).Top + Picture13(tod2).Height) Then treffer = 1
    If (Picture5.Left + Picture5.Width) > Picture13(tod2).Left And (Picture5.Left < Picture13(tod2).Left + Picture13(tod2).Width) And Picture5.Top > Picture13(tod2).Top And Picture5.Top < (Picture13(tod2).Top + Picture13(tod2).Height) Then treffer = 1
    If treffer = 1 Then Leben.Value = Leben.Value - 1
Picture13(tod2).Top = Picture13(tod2).Top + 10
If Picture13(tod2).Top > 7320 Then Picture13(tod2).Top = -3360
Next
Dim tod3 As Integer
For tod3 = 0 To Bod11
treffer = 0
    If Picture5.Left > Picture19(tod3).Left And (Picture5.Left < Picture19(tod3).Left + Picture19(tod3).Width) And Picture5.Top > Picture19(tod3).Top And Picture5.Top < (Picture19(tod3).Top + Picture19(tod3).Height) Then treffer = 1
    If (Picture5.Left + Picture5.Width) > Picture19(tod3).Left And (Picture5.Left < Picture19(tod3).Left + Picture19(tod3).Width) And (Picture5.Top + Picture5.Height) > Picture19(tod3).Top And (Picture5.Top + Picture5.Height) < (Picture19(tod3).Top + Picture19(tod3).Height) Then treffer = 1
    If Picture5.Left > Picture19(tod3).Left And (Picture5.Left < Picture19(tod3).Left + Picture19(tod3).Width) And (Picture5.Top + Picture5.Height) > Picture19(tod3).Top And (Picture5.Top + Picture5.Height) < (Picture19(tod3).Top + Picture19(tod3).Height) Then treffer = 1
    If (Picture5.Left + Picture5.Width) > Picture19(tod3).Left And (Picture5.Left < Picture19(tod3).Left + Picture19(tod3).Width) And Picture5.Top > Picture19(tod3).Top And Picture5.Top < (Picture19(tod3).Top + Picture19(tod3).Height) Then treffer = 1
    If treffer = 1 Then Leben.Value = Leben.Value - 1
   Next
Dim Böden As Integer
For Böden = 0 To Bod1
treffer = 0
    If Picture5.Left > Picture2(Böden).Left And (Picture5.Left < Picture2(Böden).Left + Picture2(Böden).Width) And Picture5.Top > Picture2(Böden).Top And Picture5.Top < (Picture2(Böden).Top + Picture2(Böden).Height) Then treffer = 1
    If (Picture5.Left + Picture5.Width) > Picture2(Böden).Left And (Picture5.Left < Picture2(Böden).Left + Picture2(Böden).Width) And (Picture5.Top + Picture5.Height) > Picture2(Böden).Top And (Picture5.Top + Picture5.Height) < (Picture2(Böden).Top + Picture2(Böden).Height) Then treffer = 1
     If treffer = 1 Then Fall.Enabled = False
     If treffer = 1 And Fall1 > 2800 Then Leben.Value = 1
     If treffer = 1 Then Fall1 = 0
   If treffer = 0 Then Fall.Enabled = True
    If treffer = 1 Then Fly = 0
Next
Dim Böden1 As Integer
For Böden1 = 0 To Bod4
treffer = 0
    If Picture5.Left > Picture10(Böden1).Left And (Picture5.Left < Picture10(Böden1).Left + Picture10(Böden1).Width) And Picture5.Top > Picture10(Böden1).Top And Picture5.Top < (Picture10(Böden1).Top + Picture10(Böden1).Height) Then treffer = 1
    If (Picture5.Left + Picture5.Width) > Picture10(Böden1).Left And (Picture5.Left < Picture10(Böden1).Left + Picture10(Böden1).Width) And (Picture5.Top + Picture5.Height) > Picture10(Böden1).Top And (Picture5.Top + Picture5.Height) < (Picture10(Böden1).Top + Picture10(Böden1).Height) Then treffer = 1
     If treffer = 1 Then Fall.Enabled = False
     If treffer = 1 And Fall1 > 2800 Then Leben.Value = 1
     If treffer = 1 Then Fall1 = 0
   If treffer = 0 Then Fall.Enabled = True
 If treffer = 1 And Picture5.Picture = Picture6(0).Picture Then Picture5.Left = Picture5.Left + 20
If treffer = 1 And Picture5.Picture = Picture6(1).Picture Then Picture5.Left = Picture5.Left + 20
If treffer = 1 And Picture5.Picture = Picture6(2).Picture Then Picture5.Left = Picture5.Left + 20
 If treffer = 1 And Picture5.Picture = Picture6(4).Picture Then Picture5.Left = Picture5.Left - 20
If treffer = 1 And Picture5.Picture = Picture6(5).Picture Then Picture5.Left = Picture5.Left - 20
If treffer = 1 And Picture5.Picture = Picture6(6).Picture Then Picture5.Left = Picture5.Left - 20
If treffer = 1 Then Fly = 0
Next
Dim Böden2 As Integer
For Böden2 = 0 To Bod5
treffer = 0
    If Picture5.Left > Picture8(Böden2).Left And (Picture5.Left < Picture8(Böden2).Left + Picture8(Böden2).Width) And Picture5.Top > Picture8(Böden2).Top And Picture5.Top < (Picture8(Böden2).Top + Picture8(Böden2).Height) Then treffer = 1
    If (Picture5.Left + Picture5.Width) > Picture8(Böden2).Left And (Picture5.Left < Picture8(Böden2).Left + Picture8(Böden2).Width) And (Picture5.Top + Picture5.Height) > Picture8(Böden2).Top And (Picture5.Top + Picture5.Height) < (Picture8(Böden2).Top + Picture8(Böden2).Height) Then treffer = 1
     If treffer = 1 Then Fall.Enabled = False
     If treffer = 1 And Fall1 > 2800 Then Leben.Value = 1
     If treffer = 1 Then Fall1 = 0
   If treffer = 0 Then Fall.Enabled = True
   If treffer = 1 Then Fly = 0
Next
Dim Böden3 As Integer
For Böden3 = 0 To Bod7
treffer = 0
    If Picture5.Left > Picture14(Böden3).Left And (Picture5.Left < Picture14(Böden3).Left + Picture14(Böden3).Width) And Picture5.Top > Picture14(Böden3).Top And Picture5.Top < (Picture14(Böden3).Top + Picture14(Böden3).Height) Then treffer = 1
    If (Picture5.Left + Picture5.Width) > Picture14(Böden3).Left And (Picture5.Left < Picture14(Böden3).Left + Picture14(Böden3).Width) And (Picture5.Top + Picture5.Height) > Picture14(Böden3).Top And (Picture5.Top + Picture5.Height) < (Picture14(Böden3).Top + Picture14(Böden3).Height) Then treffer = 1
     If treffer = 1 Then Fall.Enabled = False
     If treffer = 1 And Fall1 > 2800 Then Leben.Value = 1
     If treffer = 1 Then Fall1 = 0
   If treffer = 0 Then Fall.Enabled = True
  If treffer = 1 Then Fly = 0
Picture14(Böden3).Left = Picture14(Böden3).Left + 18
If Picture14(Böden3).Left > 9480 Then Picture14(Böden3).Left = -480
Next
Dim Böden4 As Integer
For Böden4 = 0 To Bod8
treffer = 0
    If Picture5.Left > Picture15(Böden4).Left And (Picture5.Left < Picture15(Böden4).Left + Picture15(Böden4).Width) And Picture5.Top > Picture15(Böden4).Top And Picture5.Top < (Picture15(Böden4).Top + Picture15(Böden4).Height) Then treffer = 1
    If (Picture5.Left + Picture5.Width) > Picture15(Böden4).Left And (Picture5.Left < Picture15(Böden4).Left + Picture15(Böden4).Width) And (Picture5.Top + Picture5.Height) > Picture15(Böden4).Top And (Picture5.Top + Picture5.Height) < (Picture15(Böden4).Top + Picture15(Böden4).Height) Then treffer = 1
     If treffer = 1 Then Fall.Enabled = False
     If treffer = 1 And Fall1 > 2800 Then Leben.Value = 1
     If treffer = 1 Then Fall1 = 0
   If treffer = 0 Then Fall.Enabled = True
  If treffer = 1 Then Fly = 0
Picture15(Böden4).Left = Picture15(Böden4).Left - 18
If Picture15(Böden4).Left < -480 Then Picture15(Böden4).Left = 9480
Next
Dim Böden5 As Integer
For Böden5 = 0 To Bod9
treffer = 0
    If Picture5.Left > Picture16(Böden5).Left And (Picture5.Left < Picture16(Böden5).Left + Picture16(Böden5).Width) And Picture5.Top > Picture16(Böden5).Top And Picture5.Top < (Picture16(Böden5).Top + Picture16(Böden5).Height) Then treffer = 1
    If (Picture5.Left + Picture5.Width) > Picture16(Böden5).Left And (Picture5.Left < Picture16(Böden5).Left + Picture16(Böden5).Width) And (Picture5.Top + Picture5.Height) > Picture16(Böden5).Top And (Picture5.Top + Picture5.Height) < (Picture16(Böden5).Top + Picture16(Böden5).Height) Then treffer = 1
     If treffer = 1 Then Fall.Enabled = False
     If treffer = 1 And Fall1 > 2800 Then Leben.Value = 1
     If treffer = 1 Then Fall1 = 0
   If treffer = 0 Then Fall.Enabled = True
  If treffer = 1 Then Fly = 0
Picture16(Böden5).Top = Picture16(Böden5).Top + 8
If Picture16(Böden5).Top > 7320 Then Picture16(Böden5).Top = 0
Next
Dim Böden6 As Integer
For Böden6 = 0 To Bod10
treffer = 0
    If Picture5.Left > Picture17(Böden6).Left And (Picture5.Left < Picture17(Böden6).Left + Picture17(Böden6).Width) And Picture5.Top > Picture17(Böden6).Top And Picture5.Top < (Picture17(Böden6).Top + Picture17(Böden6).Height) Then treffer = 1
    If (Picture5.Left + Picture5.Width) > Picture17(Böden6).Left And (Picture5.Left < Picture17(Böden6).Left + Picture17(Böden6).Width) And (Picture5.Top + Picture5.Height) > Picture17(Böden6).Top And (Picture5.Top + Picture5.Height) < (Picture17(Böden6).Top + Picture17(Böden6).Height) Then treffer = 1
     If treffer = 1 Then Fall.Enabled = False
     If treffer = 1 And Fall1 > 2800 Then Leben.Value = 1
     If treffer = 1 Then Fall1 = 0
   If treffer = 0 Then Fall.Enabled = True
  If treffer = 1 Then Fly = 0
If treffer = 1 Then Picture5.Top = Picture5.Top - 8
Picture17(Böden6).Top = Picture17(Böden6).Top - 8
If Picture17(Böden6).Top < 0 Then Picture17(Böden6).Top = 7320
Next
If Picture5.Left < 240 Then Picture5.Left = 241
If Picture5.Left > 9240 Then Picture5.Left = 9239
If Picture5.Top > 6880 Then Picture5.Top = 6879
Label1.Caption = KeystoWin
 Dim Key1 As Integer
    For Key1 = 0 To 4
    treffer = 0
    If Picture5.Left > Picture9(Key1).Left And (Picture5.Left < Picture9(Key1).Left + Picture9(Key1).Width) And Picture5.Top > Picture9(Key1).Top And Picture5.Top < (Picture9(Key1).Top + Picture9(Key1).Height) Then treffer = 1
    If (Picture5.Left + Picture5.Width) > Picture9(Key1).Left And (Picture5.Left < Picture9(Key1).Left + Picture9(Key1).Width) And (Picture5.Top + Picture5.Height) > Picture9(Key1).Top And (Picture5.Top + Picture5.Height) < (Picture9(Key1).Top + Picture9(Key1).Height) Then treffer = 1
    If Picture5.Left > Picture9(Key1).Left And (Picture5.Left < Picture9(Key1).Left + Picture9(Key1).Width) And (Picture5.Top + Picture5.Height) > Picture9(Key1).Top And (Picture5.Top + Picture5.Height) < (Picture9(Key1).Top + Picture9(Key1).Height) Then treffer = 1
    If (Picture5.Left + Picture5.Width) > Picture9(Key1).Left And (Picture5.Left < Picture9(Key1).Left + Picture9(Key1).Width) And Picture5.Top > Picture9(Key1).Top And Picture5.Top < (Picture9(Key1).Top + Picture9(Key1).Height) Then treffer = 1
   If treffer = 1 Then Picture9(Key1).Left = 22222
   If treffer = 1 Then KeystoWin = KeystoWin + 1
If treffer = 1 Then Label4.Caption = Label4.Caption + punkte
Next
Dim Tür As Boolean
If KeystoWin >= 5 Then Tür = True
If Tür = True Then Call Levelende
Dim tod As Integer
For tod = 0 To Bod2
treffer = 0
    If Picture5.Left > Picture4(tod).Left And (Picture5.Left < Picture4(tod).Left + Picture4(tod).Width) And Picture5.Top > Picture4(tod).Top And Picture5.Top < (Picture4(tod).Top + Picture4(tod).Height) Then treffer = 1
    If (Picture5.Left + Picture5.Width) > Picture4(tod).Left And (Picture5.Left < Picture4(tod).Left + Picture4(tod).Width) And (Picture5.Top + Picture5.Height) > Picture4(tod).Top And (Picture5.Top + Picture5.Height) < (Picture4(tod).Top + Picture4(tod).Height) Then treffer = 1
    If Picture5.Left > Picture4(tod).Left And (Picture5.Left < Picture4(tod).Left + Picture4(tod).Width) And (Picture5.Top + Picture5.Height) > Picture4(tod).Top And (Picture5.Top + Picture5.Height) < (Picture4(tod).Top + Picture4(tod).Height) Then treffer = 1
    If (Picture5.Left + Picture5.Width) > Picture4(tod).Left And (Picture5.Left < Picture4(tod).Left + Picture4(tod).Width) And Picture5.Top > Picture4(tod).Top And Picture5.Top < (Picture4(tod).Top + Picture4(tod).Height) Then treffer = 1
    If treffer = 1 Then Leben.Value = Leben.Value - 1
Next
Dim tod1 As Integer
For tod1 = 0 To Bod3
treffer = 0
    If Picture5.Left > Picture3(tod1).Left And (Picture5.Left < Picture3(tod1).Left + Picture3(tod1).Width) And Picture5.Top > Picture3(tod1).Top And Picture5.Top < (Picture3(tod1).Top + Picture3(tod1).Height) Then treffer = 1
    If (Picture5.Left + Picture5.Width) > Picture3(tod1).Left And (Picture5.Left < Picture3(tod1).Left + Picture3(tod1).Width) And (Picture5.Top + Picture5.Height) > Picture3(tod1).Top And (Picture5.Top + Picture5.Height) < (Picture3(tod1).Top + Picture3(tod1).Height) Then treffer = 1
    If Picture5.Left > Picture3(tod1).Left And (Picture5.Left < Picture3(tod1).Left + Picture3(tod1).Width) And (Picture5.Top + Picture5.Height) > Picture3(tod1).Top And (Picture5.Top + Picture5.Height) < (Picture3(tod1).Top + Picture3(tod1).Height) Then treffer = 1
    If (Picture5.Left + Picture5.Width) > Picture3(tod1).Left And (Picture5.Left < Picture3(tod1).Left + Picture3(tod1).Width) And Picture5.Top > Picture3(tod1).Top And Picture5.Top < (Picture3(tod1).Top + Picture3(tod1).Height) Then treffer = 1
    If treffer = 1 Then Leben.Value = Leben.Value - 1
Next
Dim Gegner As Integer
For Gegner = 0 To Bod11
If Picture19(Gegner).Picture = Picture18(0).Picture Then Picture19(Gegner).Left = Picture19(Gegner).Left + 20
If Picture19(Gegner).Picture = Picture18(1).Picture Then Picture19(Gegner).Left = Picture19(Gegner).Left + 20
If Picture19(Gegner).Picture = Picture18(2).Picture Then Picture19(Gegner).Left = Picture19(Gegner).Left - 20
If Picture19(Gegner).Picture = Picture18(3).Picture Then Picture19(Gegner).Left = Picture19(Gegner).Left - 20
If Picture19(Gegner).Left >= 9480 Then Picture19(Gegner).Picture = Picture18(2).Picture
If Picture19(Gegner).Left < 0 And Picture19(Gegner).Left < 9480 Then Picture19(Gegner).Picture = Picture18(0).Picture
Next
If Leben.Value = 0 Then WindowsMediaPlayer1.Controls.Stop
If Leben.Value = 0 Then Unload Me
If Leben.Value = 0 Then Form0.Show
Label6.Caption = Leben.Value
If Leben.Value < 66 Then Label6.ForeColor = &HFFFF&
If Leben.Value < 26 Then Label6.ForeColor = &HFF&
End Sub
Sub Levelende()
treffer = 0
    If Picture5.Left > Picture11(0).Left And (Picture5.Left < Picture11(0).Left + Picture11(0).Width) And Picture5.Top > Picture11(0).Top And Picture5.Top < (Picture11(0).Top + Picture11(0).Height) Then treffer = 1
    If (Picture5.Left + Picture5.Width) > Picture11(0).Left And (Picture5.Left < Picture11(0).Left + Picture11(0).Width) And (Picture5.Top + Picture5.Height) > Picture11(0).Top And (Picture5.Top + Picture5.Height) < (Picture11(0).Top + Picture11(0).Height) Then treffer = 1
    If Picture5.Left > Picture11(0).Left And (Picture5.Left < Picture11(0).Left + Picture11(0).Width) And (Picture5.Top + Picture5.Height) > Picture11(0).Top And (Picture5.Top + Picture5.Height) < (Picture11(0).Top + Picture11(0).Height) Then treffer = 1
    If (Picture5.Left + Picture5.Width) > Picture11(0).Left And (Picture5.Left < Picture11(0).Left + Picture11(0).Width) And Picture5.Top > Picture11(0).Top And Picture5.Top < (Picture11(0).Top + Picture11(0).Height) Then treffer = 1
    If treffer = 1 Then WindowsMediaPlayer1.Controls.Stop
    If treffer = 1 Then End
End Sub
Private Sub Timer2_Timer()
Dim Gegner1 As Integer
Dim Ch1 As Integer
Dim Ch2 As Integer
Dim Ch3 As Integer
Dim Ch4 As Integer
For Gegner1 = 0 To Bod11
If Picture19(Gegner1).Picture = Picture18(0).Picture Then GoTo 1
If Picture19(Gegner1).Picture = Picture18(1).Picture Then GoTo 2
If Picture19(Gegner1).Picture = Picture18(2).Picture Then GoTo 3
If Picture19(Gegner1).Picture = Picture18(3).Picture Then GoTo 4
Next
1:
For Ch1 = 0 To Bod11
If Picture19(Ch1).Picture = Picture18(0).Picture Then
Picture19(Ch1).Picture = Picture18(1).Picture
End If
Next
GoTo ende
2:
For Ch2 = 0 To Bod11
If Picture19(Ch2).Picture = Picture18(1).Picture Then
Picture19(Ch2).Picture = Picture18(0).Picture
End If
Next
GoTo ende
3:
For Ch3 = 0 To Bod11
If Picture19(Ch3).Picture = Picture18(2).Picture Then
Picture19(Ch3).Picture = Picture18(3).Picture
End If
Next
GoTo ende
4:
For Ch4 = 0 To Bod11
If Picture19(Ch4).Picture = Picture18(3).Picture Then
Picture19(Ch4).Picture = Picture18(2).Picture
End If
Next
ende:
End Sub
Private Sub Zeit_Timer()
If zeit2 = zeit1 Then MsgBox "Zeit überschritten!"
If zeit2 = zeit1 Then End
zeit2 = zeit2 + 1
Label2.Caption = zeit2
Label3.Caption = "/" & zeit1
End Sub


Das war Form 6, hoffe das hilft dir weiter bei meiner Frage... Ganz unten ist der Zeit Timer Wink Das selbe ist auch bei der Musik...

ACHTUNG!!!!

Wichtige Frage: Wenn ich Form6 öffne sagt Form4 Mad das ein Steuerelemt das in Form6 erstellt werden soll nicht existiert...




Das Copyright dieses Codes liegt bei mir und den leuten dir mir ausßlichlich in diesem Forum halfen.Jegliche veröffenlichung und nicht private Nutzung, die nur unter meinem Nicname stattfinden muss, wird zur Anzeige gebracht
Nein danke, ich kaufe nichts!
 
christopher.g
Überflieger
Überflieger

Anmeldedatum: 03.05.2008
Beiträge: 565


Verfasst am: 28.09.2010, 10:44

oii
ich muss dir sagen ich seh jetzt nicht wo es hängen könnte
vl hab ichs nur übersehen

aber ansonsten würd ich sagen du könntest den interval verdoppeln..
vl passts dann mit der zeit zusammen.

is aber auch nur notdürftig
 
PokemonProgrammierer
Newbie
Newbie

Anmeldedatum: 23.07.2010
Beiträge: 14


Verfasst am: 28.09.2010, 16:30


Danke, habs gelöst musste einfach in Form6 die Timer für Music,Zeit, Abfragen und Gegner alle auf false setzen
Jetzt gibst hofentlich keine bugs mehr. Danke für deine hilfe Laughing Surprised Very Happy Smile Razz
Nein danke, ich kaufe nichts!
 
Neues Thema eröffnen   Neue Antwort erstellen    Visual Basic Forum Foren-Übersicht -> [VB6] Fragen - Antworten

Tags: gegner

 
 Verwandte Themen   Aufrufe   Letzter Beitrag 
Keine neuen Beiträge Keygen - Hilfe bitte 1102 29.08.2007, 10:38
Keine neuen Beiträge Screenshot , hilfe ;) Speichern bzw jo 707 27.05.2007, 10:30
Keine neuen Beiträge hilfe bei ini maker 707 30.04.2007, 22:26
Keine neuen Beiträge [VB] suche hilfe beim 1. projekt 853 02.04.2007, 01:39
Keine neuen Beiträge proxy checker hilfe 1013 30.03.2007, 10:21
 


[ Time: 0.2362s ][ Queries: 118 (0.0853s) ][ GZIP on - Debug on ]