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

(HELP URGENT) Boundaries and Movement of Object

Community Beginner ,
May 14, 2018 May 14, 2018

I'm trying to make a Pac-Man game i have drawn the map and the pac-man however there are 3 problems i have at the moment.
1) My Pac-Man spawns outside of the map.

2) My Map has some loopholes whereby i am able to pass through the blocks that are meant to serve as a boundary.

3) I don't want my background to be moving so its static and the only thing that can move at the moment right now is my Pac-Man.

https://drive.google.com/open?id=1LcKtBp6VuPnnjyAMTkW6aRxqnyWNk26n

TOPICS
ActionScript
402
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
New Here ,
May 14, 2018 May 14, 2018

Hi,

1) My Pac-Man spawns outside of the map.

Where do you want your "Pac-Man" to appear?

2) My Map has some loopholes whereby i am able to pass through the blocks that are meant to serve as a boundary.

Boundaries for what?

3) I don't want my background to be moving so its static and the only thing that can move at the moment right now is my Pac-Man.

And your question is?

Your questions need to be more specific really. The readers can "guess" what you are trying to say but to get a much better answer, be specific.

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 ,
May 14, 2018 May 14, 2018

Yeah so about the 3 problems i mentioned,

I was wondering how to make my "Pac-Man" appear where i specifically want to at the beginning after control + enter to view it.

How to make the Map unbreachable so it doesnt go out once its inside and with the layout of the map it doesnt go through the blocks

Also how to make my screen static so that it doesnt zoom in and follow the object that is moving.

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
New Here ,
May 14, 2018 May 14, 2018
LATEST

Hi,

(I will assume you are writing in AS3)

I was wondering how to make my "Pac-Man" appear where i specifically want to at the beginning after control + enter to view it.

To make an object/movieclip appear where you want it to:

var myPacMan:PacMan = new PacMan();// This could also be your pac man asset you have saved in your fla file.

myPacMan.x = myXLocationOnScreen;

myPacMan.y = myYLocationOnScreen;

addChild(myPacMan);

If you want it to appear inside of an object, lets say a map

myMap.addChild(myMov);

Think about OOP as Russian dolls. If you want to get access to any of the dolls you will need to be able to reference the doll objects.

Now this can be done in a number of ways, but I wont bore you with the more technical ways.

In the example I've given above, myMap is the parent doll, and I want to put "myPacMan" inside of myMap. One way to do this is simple myMap.addchild(myPacMan).

But you still have to position it within "myMap". In the example above I've set external none descript locations for x and y.

But for the same of argument, you could also have a location marker set inside of your myMap movieclip instance..........

The list really is endless here as you can have so many variables sooooooo many possibly options so the best thing you can do is learn from someone else's example.

Download this example and break it. (I've only had a quick look as this repo but the main.as class looks a like a very good starting point for you).

If you need a little more help running this example then give another shout out, or, strip back your questions as so they are more specific.

Sorry I could not be of more help but it sounds as though there are more answers than questions here.

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