3 Replies - 692 Views - Last Post: 15 January 2016 - 01:19 PM Rate Topic: -----

#1 ditritium256   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 15-January 16

"Jumping Image Box"

Posted 15 January 2016 - 12:38 PM

So what I am trying to do is make an image box "jump" on top of shapes, each shape being higher than the other. Here is the coding that I have so far. With this, the guy goes up so far, stops where the first shape should be, but won't let me jump any higher. How would I come about doing it properly?
Jumping
Image9.Top = Image9.Top - 100
If Image9.Top <= z + 7800 Then
    Jump.Enabled = False: Falling.Enabled = True
End If

[u]Falling[/u]
Image9.Top = Image9.Top + 100
If Image9.Top >= Me.ScaleHeight - Image9.Height Then
    Falling.Enabled = False
End If
If Image9.Top <= Shape1.Top - Image9.Height And Image9.Left >= Shape1.Left - Image9.Width Then
    Falling.Enabled = False
End If


Is This A Good Question/Topic? 0
  • +

Replies To: "Jumping Image Box"

#2 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 15478
  • View blog
  • Posts: 62,011
  • Joined: 12-June 08

Re: "Jumping Image Box"

Posted 15 January 2016 - 12:58 PM

Have you put a breakpoint in your code to track what is happening/not happening with it when on top of another object? Maybe it is 'inside' another object's boundaries or confused on its current state.
Was This Post Helpful? 0
  • +
  • -

#3 ditritium256   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 15-January 16

Re: "Jumping Image Box"

Posted 15 January 2016 - 01:13 PM

I haven't put a break point anywhere. I am still relatively new to programming and am unsure exactly what a break point is. Could you explain? Many thanks...
Was This Post Helpful? 0
  • +
  • -

#4 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 15478
  • View blog
  • Posts: 62,011
  • Joined: 12-June 08

Re: "Jumping Image Box"

Posted 15 January 2016 - 01:19 PM

When in VB6's IDE you should be able to click in the left hand margins to put little red dots on lines.. these are break points.. they stop execution of the code when it is ran from the IDE so you can step through the logic, examine variables, and assess values.

VB6-ish reading on the subjects:

https://msdn.microso...v=vs.90%29.aspx
https://msdn.microso...v=vs.60%29.aspx
https://msdn.microso...y6%28v=vs.90%29
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1