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 7734685
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T07:18:44+00:00 2026-06-01T07:18:44+00:00

I have a seed object which has an instance method seed:fall() which is called

  • 0

I have a “seed” object which has an instance method seed:fall() which is called by my update function (which runs every frame). I’ve got a “touch” event listener on it so the user can drag it around. When it’s being dragged, however, it’s still trying to fall, which makes the drag interaction glitchy.

I’ve added an instance variable to my seed “class” called seed.falling. The fall() function now checks that seed.falling is true before moving the seed down the screen. The next step is to set seed.falling to false when the drag starts, and then set it back to true when the drag stops. I can’t figure out this last part though.

Any ideas anyone? Is there a “stop dragging” event i could set a listener for, to switch seed.falling back on? Is there a nicer way of achieving what i want?

  • 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-06-01T07:18:45+00:00Added an answer on June 1, 2026 at 7:18 am
    physics.start()
    physics.setGravity(0,1)
    local dd = display.newRect(400,100,200,200)
    physics.addBody(dd,"dynamic")
    dd:addEventListener("touch", function(event)
        if event.phase == "began" then
            dd.bodyType = "static"
        elseif event.phase == "moved" then
            dd.x,dd.y = event.x,event.y
        elseif event.phase == "ended" then
            dd.bodyType = "dynamic"
        end
    end)
    

    I think this case is what you want?

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

Sidebar

Related Questions

I'm trying to create an array in one method (or function? Or object? Side
I am using a System.Random object which is instantiated with a fixed seed all
was wondering if you could help me out: I have a method called initializeAll
I have a specific situation where I've got an object that I want to
I have a rake task to seed an application with random data using the
I have state data in a txt file that I used to seed my
I have an application requiring the same results given the same random seed. But
Have just started using Visual Studio Professional's built-in unit testing features, which as I
what I mean by that is: I basically have a class that has too
I have an Android app which uses Jackson parser for JSON parsing. After I've

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.