Results 1 to 2 of 2

Thread: Moving Randomly Shapes on the Screen, Left to Right

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2003
    Location
    Australia
    Posts
    14

    Question Moving Randomly Shapes on the Screen, Left to Right

    Hi,

    I am about to start making a simple game in VB.NET, its like galaga style of game, i juz need a bit of help..

    Can anyone show me a code of randomly moving a shape from left to right? for example a rectange...Should i use a for loop?

    ANy help will be much appreciated


    Thanks

  2. #2
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682
    I'm not much of a VB.net afficionado, but what I'd do is create a class that has properties to control its X and Y speeds, and anything else you need.

    Make as many instances of this object as you need, assign speeds to each one. Then in the main game loop tell each object to move a single step by an amount dictated by the X & Y speeds.

    It'd be easiest to create an array of the objects and loop through them.

    If you need more specific graphical help then I'm not much cop, but no doubt someone else has an idea.
    I don't live here any more.

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