Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

how do i make a pac-man game in actionscript 2.0? (im using flash 8)

Community Beginner ,
Sep 06, 2023 Sep 06, 2023

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)

thingy idk.pngexpand image

SGL
2.2K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Sep 09, 2023 Sep 09, 2023

@SuperGibaLogan 

here you go. https://youtu.be/3pttkzOW3Sg?si=EVybOkevYHPPRFew

Work Smarter not harder. 

Translate
Community Expert ,
Sep 06, 2023 Sep 06, 2023

you've already been helped with some of this.  have you tried adding to that yourself?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 06, 2023 Sep 06, 2023

i know, its just that i dont have money

SGL
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 06, 2023 Sep 06, 2023

i didn't ask about hiring someone. i asked if you've tried to do anything yourself.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 06, 2023 Sep 06, 2023

i didnt try to do it myself

SGL
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 06, 2023 Sep 06, 2023

ok.  good luck.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 06, 2023 Sep 06, 2023

but the problem is i dont know much about actionscript 2.0, i only know a few stuff like making puzzle games

SGL
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 06, 2023 Sep 06, 2023

i understand. we're just making it clear you're asking someone to do your work for you.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 06, 2023 Sep 06, 2023

but maybe i could try to do the code, is it ok if i show you it? not trying to be rude or anything

SGL
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 06, 2023 Sep 06, 2023

that's exactly what i suggested previously.  give it a try.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 06, 2023 Sep 06, 2023

alright, ill try

SGL
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 06, 2023 Sep 06, 2023

keep this thread updated.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 06, 2023 Sep 06, 2023

ok

SGL
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 06, 2023 Sep 06, 2023

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;
}

}

SGL
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 06, 2023 Sep 06, 2023

that code requires the key be held down.

 

you should start with the code i gave previously.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 06, 2023 Sep 06, 2023

alright, the code you gave me in the last post i made?

SGL
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 06, 2023 Sep 06, 2023

the code i gave to move when a key is only pressed, not requiring the holding of the key

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 06, 2023 Sep 06, 2023

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);

SGL
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 06, 2023 Sep 06, 2023

i think ill take a break

SGL
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 06, 2023 Sep 06, 2023

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

SGL
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 07, 2023 Sep 07, 2023

my error.

 

i forgot i never sent that code in the previous conversation.  ie, start with:

 

var keyListener:Object = new Object();
var speed = 7;
var dir;
var tl = this;
 
keyListener.onKeyDown = function() {
if (Key.getCode() == 37) {
dir = "left";
} else if (Key.getCode() == 39) {
dir = "right";
} else if (Key.getCode() == 38) {
dir = "up";
} else if (Key.getCode() == 40) {
dir = "down";
}
if (!tl.onEnterFrame) {
tl.onEnterFrame = loopF;
// tl.onEnterFrame = null when wall hit
}
};
Key.addListener(keyListener);
 
function loopF() {
switch (dir) {
case "left" :
object1._x -= speed;
break;
case "right" :
object1._x += speed;
break;
case "up" :
object1._y -= speed;
break;
case "down" :
object1._y += speed;
break;
}
}
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 07, 2023 Sep 07, 2023

thanks! now i gotta make pac-man to only go only on the orange area

SGL
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 07, 2023 Sep 07, 2023

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 07, 2023 Sep 07, 2023

ok, can i send an image with the borders when i finish it?

SGL
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 07, 2023 Sep 07, 2023

also do i need to add an instance name to the borders?

SGL
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines