A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: !!!!Please help me with my Game!!!!

  1. #1
    Junior Member
    Join Date
    Dec 2001
    Posts
    2
    I'm a begginer and i'm trying to make a simple game. How do i make solid figure like, if i had a square how would i make it that my guy couldn't pass over it. I'm pretty stumped could you help me?

  2. #2
    Senior Member
    Join Date
    Feb 2001
    Posts
    314
    That all depends.

    There are several possible ways that you could structure your game, and each would involve a different way of doing this.

    There are also several different ways that you might move your character, which would change the code, too.

    But the easiest way is probably to use hitTest. Both the square and the guy have to be movie clips. Something like this:

    if (guy.hitTest(square)){
    [reverse whatever you did to move the guy over the square]
    }

    I hope that helps, although there's really a lot more to consider than what's possible in a simple answer like this.

    You can learn more about the hitTest method on page 94 of the ActionScript Reference Guide (that comes with Flash 5).

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