• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 238
  • Last Modified:

actionscript gravity problem

Hey guys,

I'm creating a little game, where you can change gravity.
Changing gravity works like a charm, as soon as you hit a platform you stop falling.
The problem now is, when you now walk off a platform, you float in midair, to understand this fully you'll need the .fla file.

So I've added the .fla and I hope you guys can help me!

thanks dimension-switch-CS4.fla
0
ErnstJacobs
Asked:
ErnstJacobs
  • 4
  • 3
1 Solution
 
dgofmanCommented:
I attached a new version of your file. I passed from two zones
dimension-switch-CS4.fla
0
 
ErnstJacobsAuthor Commented:
Hey dgofman, thank you, but the problem is not solved. It still does not fall of a platform when you leave the platform, you just float in mid air.
0
 
dgofmanCommented:
That you can finish. Now the code it's clean and you can add additional logics
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
ErnstJacobsAuthor Commented:
Right now I'm trying the following
function playerCollide() {
	for(var i = 0; i < hwalls.length; i++) {
		if(player.hitTestObject(hwalls[i])) {
			if(player.y < hwalls[i].y){
				player.y -= 2.1;
			}
			if(player.y > hwalls[i].y) {
				player.y += 2.1;
			}
			
			//plr_inAir = false;
		}
	}

Open in new window


It almost works, but when I hit a platform on top of level I slowly through it. And I cannot fix this.
Should I still be looking in the plr_inAir variable? And in which function should I implement it, can you give me those hints? ;) I cannot get it to work yet
0
 
dgofmanCommented:
Can you tell me first provide a rule of the game I didn't play before such game
0
 
ErnstJacobsAuthor Commented:
You just need to cross the level as fast ad you can with just switching gravity.
But the only problem left is that when you leave a platform you're still floating.

Right now I'm making the level more complicated, after that only the falling of of a platform is the only thing that needs to be fixed. So, when you leave a platform u need to fall down (or up according to the gravity setting).

I'd like you to play the game once when the pre-release is done ;) If you'd like it anyway
0
 
dgofmanCommented:
continue working on your code because I am busy now and submit by end of this day probably after 8 hours and I will review.  So, your object cannot touch the platform s too?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now