Copy link to clipboard
Copied
im working on a pac-man game in flash 8, using actionscript 2.0, i need pac-man to only move in a certain area, i also need pac-man to move forever when a key is only pressed, not holding the key
i also need pac-man to move to the direction when he gets to an area where you can make the direction (example: pac-man is about to move to the left, that has an open area for pac-man to go up, when i press the up key before pac-man enters the area, pac-man will go up when he reaches a wall and go up)
i also need pac-man to stop moving when he goes to a wall, but still be able to control pac-man
like this:
(the yellow square is pac-man, the orange stuff is the area)
1 Correct answer
here you go. https://youtu.be/3pttkzOW3Sg?si=EVybOkevYHPPRFew
Work Smarter not harder.
Copy link to clipboard
Copied
you've already been helped with some of this. have you tried adding to that yourself?
Copy link to clipboard
Copied
i know, its just that i dont have money
Copy link to clipboard
Copied
i didn't ask about hiring someone. i asked if you've tried to do anything yourself.
Copy link to clipboard
Copied
i didnt try to do it myself
Copy link to clipboard
Copied
ok. good luck.
Copy link to clipboard
Copied
but the problem is i dont know much about actionscript 2.0, i only know a few stuff like making puzzle games
Copy link to clipboard
Copied
i understand. we're just making it clear you're asking someone to do your work for you.
Copy link to clipboard
Copied
but maybe i could try to do the code, is it ok if i show you it? not trying to be rude or anything
Copy link to clipboard
Copied
that's exactly what i suggested previously. give it a try.
Copy link to clipboard
Copied
alright, ill try
Copy link to clipboard
Copied
keep this thread updated.
Copy link to clipboard
Copied
ok
Copy link to clipboard
Copied
maybe i could edit this code to make it work like the way i explained it in my post:
onClipEvent(enterFrame){
if(Key.isDown(Key.RIGHT)){
this._x += 5;
}
if(Key.isDown(Key.LEFT)){
this._x -= 5;
}
if(Key.isDown(Key.UP)){
this._y -= 5;
}
if(Key.isDown(Key.DOWN)){
this._y += 5;
}
}
Copy link to clipboard
Copied
that code requires the key be held down.
you should start with the code i gave previously.
Copy link to clipboard
Copied
alright, the code you gave me in the last post i made?
Copy link to clipboard
Copied
the code i gave to move when a key is only pressed, not requiring the holding of the key
Copy link to clipboard
Copied
ok, this one
var keyListener:Object = new Object();
speed = 7;
keyListener.onKeyDown = function() {
if(Key.getCode()==37){
object1._x -= speed
} else if(Key.getCode()==39){
object1._x += speed
} else if(Key.getCode()==38){
object1._y -= speed;
} else if(Key.getCode()==40){
object1._y += speed;
}
};
Key.addListener(keyListener);
Copy link to clipboard
Copied
i think ill take a break
Copy link to clipboard
Copied
ok ima get back to work now
also is it ok if i can show you the code? you can give me some tips if you want
Copy link to clipboard
Copied
my error.
i forgot i never sent that code in the previous conversation. ie, start with:
Copy link to clipboard
Copied
thanks! now i gotta make pac-man to only go only on the orange area
Copy link to clipboard
Copied
i recommend creating a horizontal movieclip with a movieclip border and using a hittest to detect a user moving out of the path.
same with a vertical movieclip.
then construct your course with those pieces.
Copy link to clipboard
Copied
ok, can i send an image with the borders when i finish it?
Copy link to clipboard
Copied
also do i need to add an instance name to the borders?

