Getting logic to draw a random image

Discussion in 'C-Touch/HomeGate/SchedulePlus/PICED Software' started by pastorhinn, May 16, 2007.

  1. pastorhinn

    pastorhinn

    Joined:
    Aug 4, 2006
    Messages:
    43
    Likes Received:
    0
    hey guys and gals,
    This is probably easy for someone who does it all the time but for me i just cant see a way out.

    I would like to know if there is a way to make the logic draw an image randomly from a selected list of images. Im trying to make a game which is another version of the chase the dot game that some one posted in logic examples a while ago. now the x and y values are generated randomly and then i want the logic to draw an image from a list of 4 totally randomly at the random x and y location.

    I await an answer eagerly. And thanks in advance to anyone willing to help.
    pastor hinn
     
    pastorhinn, May 16, 2007
    #1
  2. pastorhinn

    Darren Senior Member

    Joined:
    Jul 29, 2004
    Messages:
    2,361
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    Something like :

    Code:
    case random(4) of
      0 : DrawImage(x, y, "image1.jpg", true);
      1 : DrawImage(x, y, "image2.jpg", true);
      2 : DrawImage(x, y, "image3.jpg", true);
      3 : DrawImage(x, y, "image4.jpg", true);
    end;
    
     
    Darren, May 17, 2007
    #2
  3. pastorhinn

    pastorhinn

    Joined:
    Aug 4, 2006
    Messages:
    43
    Likes Received:
    0
    o cheersssssssss

    sick wicked awesome i can start putting my hair back in now after pulling it all out. I hadn't thought to write it like that.

    your a life saver thanks heaps.
     
    pastorhinn, May 17, 2007
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.