A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: [AS3] [HELP] Point and Click adventure game

  1. #1
    Junior Member
    Join Date
    Nov 2006
    Posts
    16

    [AS3] [HELP] Point and Click adventure game

    Hi there every one, I am after a bit of help... Basicly I am trying and failing to create a point and click adventure game like Monkey Island. So far I have got the character moving where the mouse clicks, the problem is i cant figure out how to get the character to move away from the camera and to stop at the edges of the playable area.

  2. #2
    Junior Member
    Join Date
    Nov 2009
    Posts
    28
    Firstly, i dont know what you mean by move away from the camera. But if you have managed to get your char to move to were you click the mouse, what exaclty have you found hard about making to stop at the edge of the stage.

    if (char._x > *how ever big the stage x is*){
    char._x = *how ever big the stage x is*
    }

    Can you see the logic? If you need more help post some code and ill show you, but its very very simple. You should be right

  3. #3
    Senior Member
    Join Date
    Sep 2006
    Posts
    132
    I have been working on this type of movement and agree with amcotterill, if you already know have to move the hero to a certain point, there shouldn't be a problem. I can only assume we are missing something here. Perhaps if you tell us the type of movement. In my engine, the hero moves diagonal then left or right when level with the y axis. This is one of the simplest ways without pathfinding.
    May 2009 - Working on Thorenzitha RPG - episode 7

  4. #4
    Junior Member
    Join Date
    Nov 2006
    Posts
    16
    Ok badly explained i guess lol... Ok say that there is a small room, we are looking at it side on and it has a limited floor space, what im trying to figure out is how to move the character across the floor and stop at the edge of the floor and not have the character moving all over the stage... also i need to try and get the x and y scale to decrease so the character will shrink the further up the stage you click to simulate the illusion of moving further away from the camera in larger areas... when i can get flash to stop crashing (I could be hairless by then) I will upload the AS i have so far

  5. #5
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    You could draw the walkable/clickable floor area as separate sprite and put it behind all the actual graphics so its not shown. Simplest single color fill will do. Now you can check if the mouse cursor is over the walkable area using object vs point hitTest. When it is, the click will register and char starts to walk toward the point.

  6. #6
    Junior Member
    Join Date
    Nov 2006
    Posts
    16
    awesome thankies

Tags for this Thread

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

HTML5 Development Center