• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 234
  • 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

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