Results 1 to 2 of 2

Thread: Viking Game

  1. #1

    Thread Starter
    Lively Member jamieoboth's Avatar
    Join Date
    Oct 2001
    Location
    UK
    Posts
    116

    Viking Game

    I have partly made the enclosed VB game, but I have run into a problem! I need the squares to not move more than one square outside its current posistion, and not to overlap on its own player. Please can someone edit the code and post it here, because I can't get it to work! Thanks,

    James
    Attached Files Attached Files
    Ich widerstehe allem - nur nicht der Versuchung

    (I can resist anything but temptation)

  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
    Huh try keeping the coordinates of the selected piece in variables (for example, SelX and SelY). Then you can check if the selected piece is 1 square up, down, to the right or to the left of the new tile

    Here's some pseudo-code:

    Code:
    if we're selecting a piece then
      selx=selected piece x
      sely=selected piece y
    else
      if selx-1=selected piece x and sely=selected piece y then
      'Note that this only checks if it's to the left (selx-1, sely)... you'll have to test all the 4 directions to make it work :)
        this move is valid so move it :)
      end if
    end if
    Last edited by Jotaf98; Mar 1st, 2002 at 11:43 AM.
    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