Results 1 to 6 of 6

Thread: How do I make my enemy ships move?

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2000
    Posts
    14
    I need some help with this. I am making a shoot'em up game you know where the guy you control is at the bottom shooting guys from the top, well I was woundering how to make the enemies come down and when I shoot them they die if anyone could help me with the guys coming down I would like it very much.

  2. #2
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181
    Sounds easy, but to help me I need to know how you draw the enemys?
    U use bitblt or similar? Just set vars for the coordinates na dlet them move in a loop!

    Sanity is a full time job

    Puh das war harter Stoff!

  3. #3
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800
    like this?
    Code:
    imgEnemy.top = imgEnemy.top + 40 
    'change the interval to change the speed

  4. #4
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181
    Yes? But it sounds like you are using picture boxes to display the enemys! (of course it coul also be a type, or a rect(where you'd need to change the bottom =bottom+40 too))

    Don't use pictureboxes and moving them around.

    DDraw rulez, but Bitblt does a good job in most cases, too.
    Sanity is a full time job

    Puh das war harter Stoff!

  5. #5
    Addicted Member DarkMoose's Avatar
    Join Date
    Jul 2000
    Location
    in a box
    Posts
    185
    Picture boxes are EVIL!!....uh.. hi. I made a shooter game befoure. not too difficult and good for beginnerz. Artificial Intelligence codez are merely storing info in variables and then using BitBlt to put them on the screen. You could create a new type to store X and Y for the enemy position then make a variable array for each of the enemy ships. I did something like this:

    Type Enemy
    X As Integer
    Y As Integer
    End Type

    Dim EnemyShipArray(9) As Enemy

    Private Sub YourGameLoop
    For MoveShips = 0 To 9
    EnemyShipArray(MoveShips).X = EnemyShipArray(9).X - 5
    EnemyShipArray(MoveShips).Y = EnemyShipArray(9).Y - 3
    Next MoveShips
    End Sub

    And then of course you can use another For loop to paint them all.

    BTW, how do you peoplez post segments of code on here and make it look all neat n stuff!?
    To understand recursion, one must first understand the concept of recursion.

  6. #6
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088
    Jep DarkMoose,

    Don't use Timers, Images, and not more than 1 picturebox per game. (PicBoxes are nice if you need a frame control.. and the Frame sux )

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