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

  • Home
  • SEARCH
  • 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 6955187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:42:13+00:00 2026-05-27T14:42:13+00:00

I’m trying to make a simple game, when the ball falls into certain block,

  • 0

I’m trying to make a simple game, when the ball falls into certain block, you win.

Mechanics: The ball falls through several obstacles, in the end there are two blocks, if the ball touches the left block you win, the next level will contain more blocks and less space between them.

Test the movie (click on the screen to drop the ball):
http://gabrielmeono.com/downloads/Lucky_Hit_Alpha.swf

These are the main variables:

    var winBox:QuickObject;//You win
    var looseBox:QuickObject;//You loose
    var gameBall:QuickObject;//Ball dropped

Question

Sometimes, the ball will get stock in one of the obstacles and won’t move anymore. Can I kill/remove this object from the scene?

Current Code:

package  {

import flash.display.MovieClip;
import com.actionsnippet.qbox.*;  
import flash.events.MouseEvent;
import flash.events.Event;

[SWF(width = 600, height = 600, frameRate = 60)]  

public class LuckyHit extends MovieClip {

    public var sim:QuickBox2D;
    var winBox:QuickObject;
    var looseBox:QuickObject;
    var gameBall:QuickObject;
    var simContacts:QuickContacts;

    /**
     * Constructor
     */
    public function LuckyHit()
    {
        sim = new QuickBox2D(this);
        simContacts = sim.addContactListener();
        simContacts.addEventListener(QuickContacts.ADD, contactListener);
        //sim.createStageWalls();
        winBox = sim.addBox({x:5,y:600/30, width:300/30, height:10/30, density:0});
        looseBox = sim.addBox({x:15,y:600/30, width:300/30, height:10/30, density:0});



        // make obstacles 
        for (var i:int = 0; i<(stage.stageWidth/50); i++){ 
        //End
             sim.addCircle({x:1 + i * 1.5, y:16, radius:0.1, density:0});
             sim.addCircle({x:2 + i * 1.5, y:15, radius:0.1, density:0});

        //Mid End

              sim.addCircle({x:0 + i * 2, y:14, radius:0.1, density:0});
              sim.addCircle({x:0 + i * 2, y:13, radius:0.1, density:0});
              sim.addCircle({x:0 + i * 2, y:12, radius:0.1, density:0});
              sim.addCircle({x:0 + i * 2, y:11, radius:0.1, density:0});
              sim.addCircle({x:0 + i * 2, y:10, radius:0.1, density:0});


        //Middle Start
             sim.addCircle({x:0 + i * 1.5, y:09, radius:0.1, density:0});
             sim.addCircle({x:1 + i * 1.5, y:08, radius:0.1, density:0});
             sim.addCircle({x:0 + i * 1.5, y:07, radius:0.1, density:0});
             sim.addCircle({x:1 + i * 1.5, y:06, radius:0.1, density:0});

        }

        sim.start();


        stage.addEventListener(MouseEvent.CLICK, _clicked);
    }

    /**
     * ..
     * @param e MouseEvent.CLICK
     */

    private function _clicked(e:MouseEvent)
    {
        gameBall = sim.addCircle({x:(mouseX/30), y:(1), radius:0.25, density:5});


    }

    private function contactListener(e:Event)
    {
        if (simContacts.isCurrentContact(winBox,gameBall))
        {
            // Won.
            trace ('You won!');
        }
    }


}

}

  • 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-27T14:42:14+00:00Added an answer on May 27, 2026 at 2:42 pm

    Make sure you have sleeping enabled. When a body comes to rest, it will “sleep”. You can poll your bodies and see which are sleeping.
    Here is a thread on the concept on Box2D.org.
    http://www.box2d.org/forum/viewtopic.php?f=9&t=5578

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to loop through a bunch of documents I have to put
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a French site that I want to parse, but am running into

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.