dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: [CS3] character going through walls problem

  1. #1
    Junior Member
    Join Date
    Sep 2008
    Posts
    23

    [CS3] character going through walls problem

    Hi all,

    I'm onto the 2nd level of my platform game now so i've had to move the old walls from the 1st level and put new ones in - problem is my new walls don't work, they are movie clips so i thought i could use the same instance name and leave the code as it is.

    (the 1st level walls still work fine)

    Any ideas?!

  2. #2
    Professional Air Guitarist Frag's Avatar
    Join Date
    Dec 2002
    Location
    Brain, Body, Clothes, Computer Chair, Room, House, Neighborhood, City, State, Country, Continent, World, Galaxy, Universe, and on?
    Posts
    811
    You'll need to be a lot more specific if you want an answer. Posting a sample SWF or FLA or your code would be a good way for people to actually see what's going on.

  3. #3
    Junior Member
    Join Date
    Sep 2008
    Posts
    23
    ok, the code that stops the char going through walls in level 1 is:

    Code:
    if (dir == "right" && !_root.leftblock.hitTest(this._x+20, this._y, true)) {
    			this._x += speed;
    in level 2 i moved the original movie clip (WallLeft) out of the frame and created new walls in a new movie clip (called WallLeft2) but i made the instance (leftblock) the same as the instance of the original WallLeft movie clip.

  4. #4
    Junior Member
    Join Date
    Sep 2008
    Posts
    23

    Thumbs up

    Problem solved, as is often the case the solution was simple and quite frankly the first thing i should have done...

    ... put level 2 on a new layer!

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