Results 1 to 6 of 6

Thread: Programming Question

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2001
    Location
    Baltimore,MD
    Posts
    536

    Talking Programming Question

    Iam creating a space ship like game in visual basics and I have a line on the bottom of the form where after the user dodges the blocks that once the blocks hits the line the block disappear if anyone has a code please let me know. Please check out my site at http://www.geocities.com/striver2000t/enterprise.html
    Walter Richardson
    Striver2000 Christian Productions
    Iam seventeen but since I started VB in June of 01 GOD has been helping me excell by finding this great forum with a bunch of GREAT PEOPLE!

  2. #2
    Frenzied Member Jotaf98's Avatar
    Join Date
    Jun 2000
    Location
    I'm not gonna give you my IP address! Ok... Portugal, South-Western Europe, 3rd rock from the sun (our star is easy to find, a 47 Ursae Majoris in the Milky Way :p )
    Posts
    1,457
    Are you using controls or bitblt in your game?
    Code:
    Temp = Me.GetIQ()
    'Error 9: Overflow
    'DON'T PANIC! :eek:

    To learn how to use realistic effects in your games like fire, rain, snow and magic effects, read my article on particles systems here.


    Jotaf's Theories!
    "Cats land on their feet. Toast lands peanut butter side down. A cat with toast strapped to its back will hover above the ground in a state of quantum indecision."

  3. #3
    Addicted Member DarkMoose's Avatar
    Join Date
    Jul 2000
    Location
    in a box
    Posts
    185
    I hope you're using an array for enemy fire or obstacles or whatever you have moving past this line

    Code:
    Private Type EnemyFire
         x As Integer
         y As Integer
    End Type
    Dim EnemyFireArray(9) As EnemyFire
    
    With EnemyFireArray(I)
    For I = 0 To 9
         .y = .y + 5 'moves the gunshots down the screen
         If .y > Line1.y Then 'the gunshots are below the line
              .y = -20 'above the top of the screen
              .x = Int(Rnd * 100) 'random positioning for gunshots
         End If
    Next I
    End With
    To understand recursion, one must first understand the concept of recursion.

  4. #4
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    If the block hits the line just stop drawing it !?
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  5. #5
    Addicted Member DarkMoose's Avatar
    Join Date
    Jul 2000
    Location
    in a box
    Posts
    185
    Well, I dont know. It depends on your program :\ If you want the blocks to continously move past the ship, then when it reaches the line, you just change the position that you are painting it at to the top of the screen so it will then scroll down again and again in a continuous loop
    To understand recursion, one must first understand the concept of recursion.

  6. #6
    Frenzied Member Jotaf98's Avatar
    Join Date
    Jun 2000
    Location
    I'm not gonna give you my IP address! Ok... Portugal, South-Western Europe, 3rd rock from the sun (our star is easy to find, a 47 Ursae Majoris in the Milky Way :p )
    Posts
    1,457
    If you're using controls, it's simple

    VB Code:
    1. If Block.Top > Form1.Height Then Unload Block
    Code:
    Temp = Me.GetIQ()
    'Error 9: Overflow
    'DON'T PANIC! :eek:

    To learn how to use realistic effects in your games like fire, rain, snow and magic effects, read my article on particles systems here.


    Jotaf's Theories!
    "Cats land on their feet. Toast lands peanut butter side down. A cat with toast strapped to its back will hover above the ground in a state of quantum indecision."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width