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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T16:39:03+00:00 2026-06-18T16:39:03+00:00

HI my object is moving right to left how can i change this to

  • 0

HI my object is moving right to left how can i change this to from up to down ?

function movebadc1(self,event)
        if self.x < -50 then
        self.x =300
        self.y = 300
        self.speed = math.random (2,6)
        self.initY = self.y
        self.amp = math.random (20,100)
        self.angle = math.random (1,360)

        else 
                self.x = self.x - self.speed
                self.angle = self.angle + .1
                self.y = self.amp * math.sin(self.angle)+self.initY
        end
end

Regards Kevin

  • 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-18T16:39:05+00:00Added an answer on June 18, 2026 at 4:39 pm

    To change from right to left, to up to down, supposing you also want other behavior to remain the same, change the three following lines:

                self.x = self.x - self.speed
                self.angle = self.angle + .1
                self.y = self.amp * math.sin(self.angle)+self.initY
    

    to

                self.y = self.y + self.speed
                self.angle = self.angle + .1
                self.x = self.amp * math.sin(self.angle)+self.initX
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Why doesnt this work $(#right).click(function(){ $(#sliderWindow).find(img).each(function(i) { var left = $(this).css(left); $(#imageContainer + i).animate({left:
I have an object that is moving right to left across the screen: [UIView
I'm trying to incorporate Java KeyListener to my moving object with the left/right arrows
Code in my moving object: ObjectX.Location.Add(Velocity * Utils.GetMoveDir(start, destination)); Utility function: public static PointF
I'm learning the moving object detection using a sequence of frames. This is an
I have a panel, that can be moved left or right (chosen automatically according
I have a moving object which will propelled a projectile from it when you
I started from the google's android tutorial on open gl and then used this
I want to move objects from left to right on the screen for an
I'm moving away from Serializable objects (need to cache and move things around -

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.