Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash








Walls/Boundaries


I can make the boundary of my movie the walls, (ex. rightedge=550 but how do i make a wall that isnt completely horizontal or vertical, and has multiple bends in it?




ActionScript.org Forums > ActionScript Forums Group > ActionScript 1.0 (and below)
Posted on: 09-06-2004, 10:51 PM


View Complete Forum Thread with Replies

Sponsored Links:

Walls / Boundaries
And yet another problem arises, but this time its something ive always had a problem with WALLS.

After many attempts at creating walls in games the best I can come up with is the .fla linked to this thread.

As you can see this is a very long and annoying way of creating walls.
606 lines of script is too much for a basic set of walls

If anyone can help me on finding some sort of shortcut, it would be VERY much appreciated.

View Replies !    View Related
Making Walls Or Boundaries Using Hittest()
can anyone help me out with this? im trying to make a rpg but it is no good if you cant walk around, but also have limits. any help is appreciated

View Replies !    View Related
How Do I Solve Problem Regrading Boundaries/walls Changing Scene And Question About B
Hi,

Sorry to trouble you guys again, thanks for the great advice some of you have given me. Well i am facing some queries, hope you guys can help me out.

First
I have written codes for boundaries/walls that it should let the moving character stay in the space in it, but after some tries, it still fails.

My character code:
onClipEvent (load) {
moveSpeed = 3;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)) {
this._x += moveSpeed;
} else if (Key.isDown(Key.UP)) {
this._y -= moveSpeed;
} else if (Key.isDown(Key.DOWN)) {
this._y += moveSpeed;
} else if (Key.isDown(Key.LEFT)) {
this._x -= moveSpeed;
}
}

My walls/boundaries code:

Wall 1:
onClipEvent (enterFrame)
{ if (this.hitTest(_root.Wall))
{ _x = _x+10;
}
}

Wall 2:
onClipEvent (enterFrame)
{ if (this.hitTest(_root.Wall2))
{ _y = _y+10;
}
}

Wall 3:
onClipEvent (enterFrame)
{ if (this.hitTest(_root.Wall3))
{ _y = _y-10;
}
}

Wall 4:
onClipEvent (enterFrame)
{ if (this.hitTest(_root.Wall4))
{ _y = _y-10;
}
}

Done. As for after a few tries, my character will move out of the walls and cannot stay in the visable area. Am i on the right track?

Second
I want to make my character move from scene to scene. I started by creating a door and follow a game tutorial help and try to use it. I also create another door and set the codes as taught so that the character would appear on the second position. but when i reach the door on the first scene, it does not change the scene. Can i ask how should i do or what codes i should set so that when my character step on the door/portal, it will switch the player to the next screen/map.

Third

Can i create a button and set a diameter/radius around it(e.g a telephone booth set as a button function) and when the character in the story move to the diameter of the button, it will be able to select the function if let say we press an enter key in the moblie device. (e.g when the character move to the detect space of the telephone booth, it is able to use the next scene i set for the telephone booth).

Thank you for answering my queries and spending your time reading, your help will be very useful. hope to hear from you guys as soon as possible. Thank you once again

Regrads,
-=FYProject=-

View Replies !    View Related
Walls Help
are there any tutorials anywhere on how to make a wall that a character cannot pass through? or does somebody know how to do this?

View Replies !    View Related
Walls
what I am trying to do is have a little bar follow the mouse horizontally but I have that done so what I am trying to do is make it so that when the bar goes to the edge of the screen then it will stop as if there is a wall there.

View Replies !    View Related
Walls?
Mmmmmmmmmkay

I need some help -- I have no idea how to do walls, and I'm trying to create a new version of pacman, and im not getting very far. I want to insert an action code on the walls, but if that's not the best way to do it, please tell me. Thanks alot!

-yeps

View Replies !    View Related
Walls
ok, Hi
I just need some help with walls, I know this might be easy for some but its extremely hard for me. What I need is walls that are not traspassed by the player when moving diagonally (and yes, it HAS to be able to move diagonally). I would really apreciate any help

View Replies !    View Related
Walls
What is the action script that you would put on a ''wall'' to make a movie clip called ''ball'' to bounce off slightly when it touches it?

thanks in advance,

(for flash 8)

View Replies !    View Related
Walls
Okay, I can move a 2-d character left and right, make it look like its heading towards the back, by simply using _xscale and _yscale to make it seem 3d, except for the character. But this is my actual question. How do I get the characters stop at the edge of the screen? left-right-back-foward.

Thank you in advance.

View Replies !    View Related
Walls
I wonder how I will create a flash-game with walls that like to stop the player to go past the walls.Thanks
____________________
Albert Krzymowski

View Replies !    View Related
Walls
hey guys i am using a code similar to the one kerek is using, however my platform are thicker and people keep landing about halfway thru a platform......Which is the ground, looks really fake and ruins mi game any ideas?

View Replies !    View Related
Walls
hey guys i am using a code similar to the one kerek is using, however my platform are thicker and people keep landing about halfway thru a platform......Which is the ground, looks really fake and ruins mi game any ideas?

View Replies !    View Related
Bouncin' Off The Walls
I no this is probably a novice question... but could someone quickly explain how to make a image randomly bounce off the sides of the walls and continue infinately.

Thank you for help and time.

View Replies !    View Related
Building Walls
I am working on a pac man type game where buttons move the main dude (mango). Can anyone tell me how to create barriers or walls that the dude can't go through?

View Replies !    View Related
Walls In Car Game
Hey everyone,
Im making a GTA style car game in flash MX, and i cannot figure out how to make walls and buildings work properly.
I mean, i drew them, and made them a graphic, now i need the actionscript to make them so that my car does not go through them, but hits them instead and bounces off, and i also need a script that will make 2 cars hit each other and bounce off rather than going over each other.

If someone can help me out that would be great,
Thanks a million

View Replies !    View Related
Creating Walls
I am making a racing game in flash. how do i create a wall?

View Replies !    View Related
Walking Into Walls
Hope someone out there can help me with this.

Take a look at this url:

http://www.flashkit.com/movies/Games...7738/index.php

I can't work out how to make the little figure walk round rather than stopping when it walks into a wall if the point where the mouse clicks is the other side of a wall. I want it to walk to the wall and around it not into it!!! Any ideas clever people???

Hope so!

D

View Replies !    View Related
Bouncing Off Walls
how do i get an object with motion to hit a wall then bounce off it at the appropriate angle?? and if possible with a reduced velocity?

thanx in advance

View Replies !    View Related
Game Walls
Im working on a Racing game in flash... in the game you drive a "hover craft" (just cuz i couldnt get realistic motion physics of a car) when you hit up the walls (a big square with sections for a trake erased from it) move down so you dont move but it looks like you do.. my problem is that when you hit a wall i want you to just bounce off... i have tried a few things where you either get sucked in, get stuck in between the 2, and or you just dont move and have to wiggle your way out... heres the code i used from memory

xspeed = (some formula to find speed)
yspeed = (another formula to find speed)
the motion controls
with(_root.walls){
if(cars.hittest(getbounds(_root))._xMax, _y, true) { (if thats not perfect sorry i cant completely remember it )
_x += xspeed;
_y - yspeed; (when you move forward the y is += yspeed and the x is -= yspeed so i reversed them... the current demo is at NNgames.bakagamer.net/Game2.htm

ill post more later if ur still confused

- Goat

View Replies !    View Related
Walls And That Collision
im very new to action script, and just figured out how to make an object move with arrow buttons, now i want to know how to make walls that that object cant go past, so i can make a basic maze like game. i would love help, i would also be very happy if one was to give me the exact actionscript for this.

View Replies !    View Related
Bounce Off Walls
hey guys, i've attached a file for you to look at. when you open it go to the "menu" scene (there's nothing in gameplay yet, but i will need your help there too probably in the future). in menu, see that little black ball on the right (frame 38)? can you show me what action to add to that ball to make it start from that point... pick a random direction to go in... and whenever it hits any of the walls to bounce back... i want it to just continue to bounce around the screen in the background. (of course though, i want it to bounce back continueing on at the angle it hit the wall from.... do you follow me? did i phrase that right? do you get why i'm TRYING to say?)

View Replies !    View Related
Going Thur Walls
Hi


Can you guys help with my bummper car game the .fla is at www.cheapandeasy.00freehost.com/bumper.fla no hot linking so just copy and paste.
thanks

View Replies !    View Related
I Need 2 Make Walls
I have a whole bunch of movie clips with an instance name of "wall" and I need a hitTest to make the walls stop the instance mc "ball" the one im using rite now only works on one wall:

http://www.geocities.com/neopetsgohan/maze4.fla
http://www.geocities.com/neopetsgohan/maze4.swf



My bro wrote, and won't let me delete:
And if you have a house w/o walls, then u dont have 2 help me. BUt if ur house has walls, help my maze have walls. right now its like those mazes made out of corn stockings, where u can go through! so plz help! i need privacy with the walls!

View Replies !    View Related
Impassable Walls
Im making my first flash action scripting game on MX and im sorta stuck on a script that says my "player" movieclip cannot pass through the "wall" movieclip.


im also trying to work out how i can make a washout effect on my background but is clear on the area arround the cursor..... if that makes ne sense


i hope some1 here can help me.
thx in advance
Scotty

View Replies !    View Related
Solid Walls- HELP
Hello, I'm a beginner flash user and I was wondering how to make walls solid if, say, I have movement controlled by the keys. I want the little dude i have moving around to stop when he hits an object. How can I do this?

View Replies !    View Related
Walking Through Walls
ok i know this is simple for most of you actionscript junkies out there, but how can i make my character, link, stop moving when he hits the border or wall?

i have this script for his movement:

code:
onClipEvent (load) {
moveSpeed = 11;
}
onClipEvent (enterFrame) {
if (Key.isDown (Key.RIGHT)) {
this._x += moveSpeed;
this.gotoAndStop(9)
} else if (Key.isDown (Key.UP)) {
this._y -= moveSpeed;
this.gotoAndStop(7)
} else if (Key.isDown (Key.DOWN)) {
this._y += moveSpeed;
this.gotoAndStop(6)
} else if (Key.isDown (Key.LEFT)) {
this._x -= moveSpeed;
this.gotoAndStop(8)
}
}
//The gotoAndStop; is used for animation purposes

View Replies !    View Related
Walls In Game
how do i make a wall/blocker in my game?

View Replies !    View Related
HitTest Walls
the hitTest-thing works in my "game", but only when the character meets one of the 4 walls of the rectangle. the objects inside (that are also the part of the same movie clip) doesn't react

is this wrong?

if (wall.hitTest(_root.character._x,_root.character._ y)==true){
}

any ideas?

thanx

View Replies !    View Related
Walls How Do You Create Them
hi iv started to design a billiards pool game but i cnt figure out the code for th walls if any one can help it would be a great help thanks oh the balls need to bounce of the wall to so if any one else knows the code for the balls moving randomly that would be a great help thanks

View Replies !    View Related
Problem With Walls
ive got a movieclip on the right side of the stage thats just a straight line with this actionscipt atached to it.
Code:
onClipEvent (enterFrame) {
if (this.hitTest(_root.flobchar)) {
gotoAndPlay("game",3);
}
}
my characters instance is flobchar, but when i walk into the wall nothing happens i want it to go to to the next frame.

View Replies !    View Related
Obstacles And Walls
I've been searching for weeks trying to find codes for obstacles and walls. I really need help and would appreciate if someone could help me out with some coding. Thanks alot.

View Replies !    View Related
Headbuttin' Walls
Any Flashers out there? and not in the rude sense!!

Anyway, here is my short story, and hopefully some of you might be able to help the newbie "Flasher"

Bought a template, from template monster, ok ok stop laughing, but we gotta start (cheat) somewhere right? The whole site has been made, in one .fla file.
I have edited the graphics, text etc, thats all great, managed to do that and keep it going ok.

I am using Flash MX, 6 rev2

The whole site is.....let me tab screens....is 235 frames long and has 16 layers

Everything looks fine, all uploaded to the domain,

Then i had the idea of making the "contact form" to work, which i did, with some great success, using the following:

http://www.kirupa.com/developer/acti..._php_email.htm

Edited my form to use the above, and yes!!!!! my message appeared in my mailbox! sucess! only....i recieved 19 emails, saying the same thing, because my site did not inform me that the message was sent, but when i tested kirupa
.swf file and the php script on my server, it worked fine, sent me the email, and the .swf file told me "thank you for your input"

so the downloaded .fla/.swf and the .php files i downloaded from the site works,

I notice that the downloaded form has two frames, so i just simply cut and paste the stuff into my sites .fla, exported movie, uploaded it to my server, yes the contact form show, and yes it works, but it still dont tell me that message has been sent.

So, i think i have to, some how, put the downloaded contact form into my .fla, which to the page its got to go on, is Frame number 180 of 235 and is on layer 7 i belive, how the hell do i do that?

please help me, ive looked all over the forums and cant find anything

A VERY desperate paul

View Replies !    View Related
[F8] Destructable Walls
I need to make walls that can be damaged by a bouncing ball.The ball bounces around the screen, but I want it to damage the wall bit by bit as it hits.
I want it to do this so that when the ball hits a broken wall, it will bounce at a different angle.

The only other place I have seen the effect I want is the Flash game,Tanks.
http://www.gamegarage.co.uk/shooters-games/tanks/play/

Any ideas?

View Replies !    View Related
Help With Collision With Walls?
well just within the last month iv picked up actionscript and im trying to make a simple platform game from scratch. well i couldnt get a floor to work. i was using hitTest but it never works right. i have a static ground right now. but i want to take that out and just make the ground a collision thing that stops the hero MC. so can someone please edit this to make the mc "hero" stop of hitTest with another mc, just call it "wall". oh and this code was all written to work on the first frame of _root, i just think its easier to edit when its all there. thanks


PHP Code:



gravity=2
ground=300
power=20
onEnterFrame=function(){
     yspeed-=gravity
     hero._y-=yspeed
     if(hero._y>ground){
          yspeed=0
          hero._y=300
          jumping=false
     }
     if(Key.isDown(Key.LEFT)){
          hero._x-=5;
          hero._xscale=-100;
          hero.gotoAndStop("walkright");
     }
     else if(Key.isDown(Key.RIGHT)){
          hero._x+=5;
          hero._xscale=100;
          hero.gotoAndStop("walkright");
     }
     else{
          hero.gotoAndStop("herostop");
     }
     if(Key.isDown(Key.UP)){
          if(!jumping){
               yspeed=power
               jumping=true
          }
     }
     


View Replies !    View Related
Dodgy Walls =/
Heyy,
Just have a look at the attachment and walk into the wall then try to walk back out and you'll see what the problem is...

throwback = 6
movespeed = 6
You dont need to know about cloud speed

This be my code:


ActionScript Code:
for (i = 0; i < maxbox; i++) {
    if (p1.hitTest(_root["wall"+i]))
    {
        if(Key.isDown(Key.LEFT) && facingright == false) {
            bg._x -= throwback;
            clouds._x -= cloudspeed;
           
            for(i = 0; i < maxbox; i++)
            {
                _root["platform"+i]._x -= throwback;
                _root["wall"+i]._x -= throwback;
            }
        }
        if(Key.isDown(Key.RIGHT) && facingright == true) {
            bg._x += throwback;
            clouds._x += cloudspeed;
           
            for(i = 0; i < maxbox; i++)
            {
                _root["platform"+i]._x += throwback;
                _root["wall"+i]._x += throwback;
            }
        }
    }
}

View Replies !    View Related
A Little Problem With My Walls......
I have a slight problem with my walls when I use hittest.

In my game I have a sort of maze thing, which is navigated by a guy I nicknamed "Joe"

I'm using hittest to stop Joe passing through the walls, and was having sucess untill I split the walls in half, so that the charecter wouldn't pass through it.

The wall looks like this: (if it was a diagram!)

-------------- Top movie clip
-------------- Bottom movie clip

I did this to stop the charecter passing through the walls, but when I try to pass through top movie clip, it lets me through, even though I coded to push the charecter away

the top wall code:


Code:
onClipEvent (enterFrame) {
if (this, hittest(_root.Joe)) {
_root.Joe._y = _root.Joe._y - 12;
}
}
The bottom code works fine (it's the same, but with a + sign)

Any ideas? or even better, is there another way?

Thankyou!

View Replies !    View Related
Walls For A Tank
I need to script a building so that when my tank mc hits it, it doesnt go through it. my mcs name is is barrel. so yeah if anyone can help me with that would be good. Thanks in advance

View Replies !    View Related
Flors And Walls
Hi!
I wonder how I will make a flor and a wall function that make my charakter don't walk pass the flor and the wall.
I got no ideas how to do that.

Thanks Albert

View Replies !    View Related
Need To Make Walls
i am making a game for my flash class and i need the code to make an object not go through another. i know it is a hittest and i tried making it so when it hits
speedX=-speedX;
speedY=-speedY;
this just reverses my controls
and when i set it equal to zero it locks up my character
to control that i use
if(key.isDown(KEY.UP,DOWN,LEFT,RIGHT)){
speedX/Y=+/- #
}
the basic thing is to move my character in between two lines and just in cases i control it wrong and hit a wall my controls arent reversed or locked up
please help so i dont fail out of my class
(its a high school class and my teacher grades retarded: he starts st a C and grades down from that unless you go very above and beyond the assignment)

View Replies !    View Related
Walking Through Walls?
Alright, so I've been working through the How to Create a Platform Game tutorial from the main site, and I've gotten to the point where you add in walls. Now, for whatever reason, the HitTest between the wall and the character isn't responding, letting the character walk through the walls. However, if the character is jumping, it does trigger, and after a seemingly random amount of time, it starts triggering for the character while he's walking too.
In case that wasn't very understandable, I've included the FLA here so that one can try it for themselves (just walk through the wall and you'll see the problem).
Now, I've been following the tutorial exactly , so I don't know how there could be a problem (unless it comes from using Flash 8, rather than MX '04 that the tutorial was made for), so could somebody with more knowledge please tell me what the problem is here?

View Replies !    View Related
Actionscript Walls
Code:
if(_root.You.hitTest(_root.Background.Wall1 or _root.Background.Wall2))
{_root.Speed = 0;} else {_root.Speed = 7;}
This is the code I am using for making walls but sadly ... Neither walls work :-S ... Any help plz?

Btw is there anyway I can do like ...


Code:
if(_root.You.hitTest(_root.Background.Wall))
{_root.Speed = 0;} else {_root.Speed = 7;}
And both walls be named Wall[1] and Wall[2], and in the code I can just name both walls as "Wall" Instead of "Wall1" and "Wall2" ...

but when I try to name it Wall[1] it says "Wall[1]" :Reserved By the System.

Any help?

View Replies !    View Related
A Little Problem With My Walls......
I have a slight problem with my walls when I use hittest.

In my game I have a sort of maze thing, which is navigated by a guy I nicknamed "Joe"

I'm using hittest to stop Joe passing through the walls, and was having sucess untill I split the walls in half, so that the charecter wouldn't pass through it.

The wall looks like this: (if it was a diagram!)

-------------- Top movie clip
-------------- Bottom movie clip

I did this to stop the charecter passing through the walls, but when I try to pass through top movie clip, it lets me through, even though I coded to push the charecter away

the top wall code:


Code:
onClipEvent (enterFrame) {
if (this, hittest(_root.Joe)) {
_root.Joe._y = _root.Joe._y - 12;
}
}
The bottom code works fine (it's the same, but with a + sign)

Any ideas? or even better, is there another way?

Thankyou!

View Replies !    View Related
Tutorial On Not Walkign Through Walls
making a flash game ... got my character movement down. now trying to figure out how to make the walls so that the charater can't walk through them. can anyone direct my to a tutorial?

View Replies !    View Related
PLZ Help Me I Need To Create Walls For My Game
Here is the game I am creating -> http://www.1matthew.com/speedracesummer.htm. I need the actionscript for making the walls stop the car or even better, make the car bounce. Here is the actionscript for the car.


onClipEvent(load){
accel = .2
deccel = .95
steer = .02
MINspd = -5
MAXspd = 6
}

onClipEvent(enterFrame){
if (LR = Key.isDown(Key.RIGHT)-Key.isDown(Key.LEFT)) angle += LR*steer*speed
if (UD = Key.isDown(Key.UP)-Key.isDown(Key.DOWN)) speed = Math.min(Math.max(speed+UD*accel,MINspd),MAXspd)
else speed *= deccel

_rotation = angle*180/Math.PI
_x += Math.cos(angle)*speed
_y += Math.sin(angle)*speed
if (_y<0) {
_y = 400;
}
if (_y>400) {
_y = 0;
}
if (_x<0) {
_x = 600;
}
if (_x>600) {
_x = 0;
}
}

Any help at all would be great. Thanks!

View Replies !    View Related
Making Walls For A Top Down Game?
hey, how do i make a movie clip act as a wall in a top-down game?

ive looked for a tut. on FK but didnt find much

thnx

View Replies !    View Related
How Do You Make Walls In Flash 4?
im making a pacman game in flash 4...


here is what i have so far...


the .fla

the swf

View Replies !    View Related
Question About Collisions W/ Walls And Such
If i have a character walking around named man1 and he runs into a wall...how do i make it so that he cannot go any further into the wall or bench or whatever.

Any codes or samples (especially!) would help

I appreciate anything

thanks

View Replies !    View Related
Bouncing Objects Off Walls
Ok... I am trying to get a simple object (a dot) to bounce off at a respected angle once it hits a certain point.

So far I have:
onClipEvent(Load){
_x = 200;
_y = 100;
_rotation = (Math.random() * 360) + 1;
}
onClipEvent(enterFrame){
//propulsion
_x = _x + (Math.cos(_rotation * (Math.PI / 180)) * 5);
_y = _y + (Math.sin(_rotation * (Math.PI / 180)) * 5);

Now, as far as getting the object to bounce off the wall at a respected angle, my brain just blows up. I know that the in order to get it to bounce off I need to subtract the the angle that it hit the wall at from 180. But I just get confused when writting the code. If any of you could help, I would appreciate it. Thank you.

Oh, by the way, I am using Flash MX.

View Replies !    View Related
I Need Hittest And Making Something Not Go Through Walls Help.
This is ActionScript version 1 for flash mx.

I have a ball movie clip. I want teh script to make it continually fall, but be able to move left and right with the arrow keys. wall movie clips will being comming up via motion tween and i want the ball to not go through teh wall but stop and go up with it. I'm making a falldown game. And, at teh top above teh screen there will be a bar movie clip. when the ball hits it, i want it to go to the game over frame.

please give me all the script to do that, and tell me where to put it.

thanks.

View Replies !    View Related
Gaming - Walls (Hittest)
Hi Guys, i'm trying to make a simple game where the man that you control can walk around a top-down view of an apartment.

I can get it so the hittest detects and stops him when he hits the wall, but then he won't move again.

I think it's because the man uses a play() function.

I've uploaded it to: http://download.dhardy.co.uk/Walking.fla

Really am unsure if i'm going down the right path, but hopefully i can get it sorted as i have to have it done by next friday!

Thanks in advance! Dave

View Replies !    View Related
[F8] Gravity/Ground And Walls
New to flash and I'm having some trouble making gravity and having things not go through barriers and walls. I'm using something like " if (this.hitTest(getBounds(_root).xMax, _y, true)) {
_x -= hitback; hitground = true;
}" and its not so good. Sometimes you can fall through the ground and sometimes you bounce. Could anyone give me a script on Walls and gravity and maybe explain it?

View Replies !    View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved