Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 10 of 10
  1. #1
    Join Date
    Mar 2006
    Posts
    16

    Smile Object Stop at X,Y Point

    I need to know how to make an object atop and not move any fatrther at a certain point even if it is told to move.
    This is for a board game and when a question is answeres incorrect the image moves back but if the first image is incorrect it still moves back past the board. So I neeed some code that will stop it from moving past a certain point. Fast help appreciated!
    Thank You!

  2. #2
    Join Date
    Mar 2006
    Posts
    16
    Sorry that's supposed to say


    I need to know how to make an object STOP and not move any fatrther at a certain point even if it is told to move.
    This is for a board game and when a question is answers incorrect the image moves back but if the first image is incorrect it still moves back past the board. So I neeed some code that will stop it from moving past a certain point. Fast help appreciated!
    Thank You!

  3. #3
    Join Date
    Dec 2003
    Location
    Location! Location!
    Posts
    6,137
    Okay, one way you can do this at design time even is to move your image to each place on the board that the image could possible be. Then, save each of those X and Y coordinates into a variable. How I did this was to move the image around on the Page at design time again, and then I made a note of what the Properties (left side of the IDE for AMS) stated (numbers) and then that is what you can use to make sure the images (objects, game pieces, etc.) match exactly where you want them to be at run-time! Finally, just calculate off of those fixed "land spots" and then either subtract or add to the positions to keep the game pieces inside of gameboard limits. Anyway, several ways to do this I suppose.

    Now, if you want to allow for dynamic change of the window size and objects (the board).. you need a different approach.

    Last edited by Intrigued; 05-28-2006 at 10:07 PM.
    Intrigued

  4. #4
    Join Date
    Dec 2003
    Location
    Location! Location!
    Posts
    6,137
    Here's something very basic, but it should help you out:

    http://www.amsuser.com/ams/examples/...-Intrigued.apz

    (sample project)
    Intrigued

  5. #5
    Join Date
    Mar 2006
    Posts
    16
    How can I put the size of the board instead of it using the windows size
    local tblScreenSize = Page.GetSize();
    g_nScreenWidth = tblScreenSize.Width;
    g_nScreenHeight = tblScreenSize.Height;

    Becuase the gameboard is only part of the screen
    Last edited by aquataze; 05-29-2006 at 03:30 PM.

  6. #6
    Join Date
    Mar 2006
    Posts
    16
    Or if you could edit this code to not allow an image to move left of its original position.


    if (question_index > 0) then

    if (answer_list[question_index] == "A") then
    text = "You're right. Good job!";
    Paragraph.SetText("Question",text);
    numcorrect = numcorrect + 1 BadGuy.MoveRight();
    else

    text = "Incorrect. The correct answer is "..answer_list[question_index].."!";
    Paragraph.SetText("Question",text) BadGuy.MoveLeft();
    end


    HideAnswerButtons();


    SetupNextQuestion();
    end

  7. #7
    Join Date
    Mar 2006
    Posts
    16
    Nevermind I thigured it out thank you

  8. #8
    Join Date
    Dec 2003
    Location
    Location! Location!
    Posts
    6,137
    Congrats. and no problem!
    Intrigued

  9. #9
    Join Date
    Mar 2006
    Posts
    16
    Now I just need to thigure out how to jump to a page when an image reaches a specific point.

  10. #10
    Join Date
    Oct 2005
    Location
    MI
    Posts
    524
    Following Intrigued's suggestion, if you use a set of global variables to track the coordinates of the player's progress (one set for current and a second for target) you can add your Page.Jump() action when the current==target.

    In the example I posted I used three sets of variables:
    1) Current coordinates
    2) Step coordinates (makes the player's piece step from square to square)
    3) Target coordinates (the last step in the player's turn)

    http://www.indigorose.com/forums/showthread.php?t=16282
    Yeah right. Who's the only one here who knows the illegal ninja moves from the government?

    ()))))))))o)))))))==============================================

Similar Threads

  1. HOW TO: Return a Web Browser Object to the Original URL after a Page Jump
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 02-03-2003, 09:18 AM
  2. INFO: Difference between the Media Player Object and the AVI Object
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-29-2002, 02:15 PM
  3. HOWTO: Make a Media Player Object Go Full Screen
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-23-2002, 11:23 AM
  4. Replies: 0
    Last Post: 10-04-2002, 10:09 AM

Posting Permissions

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