Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 331949
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T09:49:19+00:00 2026-05-12T09:49:19+00:00

Well first off I’m surprised actionscript 3.0 doesnt have pixel-based collision detection. Anyways I’m

  • 0

Well first off I’m surprised actionscript 3.0 doesnt have pixel-based collision detection.

Anyways I’m using a collision library found here (I’m willing to pick another library if needed)

I recorded a video to better show what I’m trying to do, in short I’m making a side scrolling game (like mario) and I want my ground (floor) to act just like ground does… when the user walks it walks on top of the ground, lol

At first I was thinking about doing a “bounce” effect where like “if user is X amount below the surface of the ground then push him up”. It seems fine but the only way I found I can do it makes my user just keep jumping once it touches the ground (not in video).

So does anyone know how to get it so that when my user is walking and he goes UP hill on the ground it will also make the users char go up too?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T09:49:19+00:00Added an answer on May 12, 2026 at 9:49 am

    There was an article posted today on reddit.com about pixel perfect collision detection in ActionScript 3 which does the collision detection portion of your problem.

    The real logic will be what to do when you detect a collision. However, have you ever noticed how most side-scrolling games use a flat walking surface?

    One idea (that doesn’t require collision detection) is to use a height map like idea. You can use an array (or the pixels in a texture) to determine the height of each section of ground along your surface. As your character moves through the scene you just index the position of the character into your height map.

    // How many pixels each index of the heightMap contains.
    // You'll probably want to use the same value as the distance
    // your character moves when the move left/right key is pressed.
    const SECTION_SIZE:int = 10; 
    
    // Fill this as a huge array with all the heights and
    // the size of this will be (mapHorizontalLengthInPixels / SECTION_SIZE).
    // Each element will be the distance from the top of the screen to 
    // place the character so it looks like it is standing on the ground.
    var heightMap:Array = [ /* ... */ ];
    
    // TODO: you might want to Tween to this value so it doesn't look chunky
    character.y = heightMap[character.x / SECTION_SIZE];
    

    To use a texture instead of an array, you just put each int that would have been put into the heightMap array into a single pixel of a BitmapData object. The advantage to using a texture is you can store a huge amount of information in a small BitmapData Object and use getPixel32() to read it out. You can generate the map once, save it (like as a png) and then embed it into the SWF.

    If you want to get fancy, and you probably will if you want platforms, bridges, moving objects and more … then use a 2d physics engine. There are a few open-source projects already including APE, Box2dAS3, Fisix, and FOAM among others. The learning curve will be higher and the coding more difficult but it may pay off for you in the end. Heck, it is an experience itself to write one from scratch if your keen!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 194k
  • Answers 194k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer It also 'works' if is read-write. If by 'not works'… May 12, 2026 at 6:45 pm
  • Editorial Team
    Editorial Team added an answer Cast foo to a set, if you don't care about… May 12, 2026 at 6:45 pm
  • Editorial Team
    Editorial Team added an answer Assuming you want to find the depth of a child… May 12, 2026 at 6:45 pm

Related Questions

Well first off I'm surprised actionscript 3.0 doesnt have pixel-based collision detection. Anyways I'm
First off: I'm working on an e-commerce site that will accept credit cards. In
First off, I read all of the suggested questions that sounded halfway relevant and
First off, I am not a DBA, but I do work in an environment
I have something here that is really catching me off guard. I have an

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.