Questions tagged [gravity]

The concept of UI widgets being dragged to a specific side of a surrounding element.

The concept of UI widgets being dragged to a specific side of a surrounding element.

Do not use this to refer to accelerometers (gravity sensors) in mobile phones. Use accelerometer instead.

832 questions
-1
votes
3 answers

How to make a sprite have gravity?

xcode 5 iOS7 sprite kit. My wish is to make a sprite that has its own gravity. Like a planet. If another sprite comes within a certain range of it, it will slowly pull the other sprite closer. I have two sprites. One moving and one stationary. When…
-1
votes
1 answer

Space object attraction in Java (Gravity)

So I'm trying to write a 2D space game in Java, and I'm trying to work out gravity for planets. What would the steps be in pseudo-code for this to happen?
Kyranstar
  • 1,650
  • 2
  • 14
  • 35
-1
votes
1 answer

(Games) Jumping and Gravity Mechanics

I am trying to create a Flash game using AS3. I am a newb in programming. The problem that I am having has to do with the game's jumping a gravity mechanics. Currently, the Up Key makes the character move upwards (speed of 20 pixels/frame) if it's…
LaPXL8R
  • 39
  • 2
  • 11
-1
votes
1 answer

Add weight to ball

I'm having troubles with the weight of a ball. I can apply gravity and a bouncing level, but I don know how to add weight. I want to do a "rock ball" and a "rubber ball", to compare it's bouncing visually. I coded that function which is called every…
gal007
  • 6,911
  • 8
  • 47
  • 70
-1
votes
1 answer

Box2d Radial Gravit Limitation coco2d

I have been tweaking with the following code to create radial gravity, http://www.vellios.com/2010/06/06/box2d-and-radial-gravity-code/ now its working fine, but I wanted it so that for example this code only gets triggered if my current sprite is…
-1
votes
5 answers

Why is there an empty space on the right of my RelativeLayout?

I have two identical, equally-sized RelativeLayouts with some text and an image that I want to be aligned to the right side. However, there seems to be some sort of padding that doesn't let me put it on the right, even though I never specified this.…
Kalina
  • 5,504
  • 16
  • 64
  • 101
-1
votes
1 answer

Making game gravity, everything goes way too quickly

So basically i'm currently working on a small project where the player will be able to fight stuff through move but the gravity is giving me kind of a problem. So basically, i got this method, checkGravity() which will check if isGravityApplicable()…
Nicolas Martel
  • 1,641
  • 3
  • 19
  • 34
-2
votes
1 answer

How to write a C program of two bodies exerting a gravitational force on each other?

I 've been set the following problem and don't have a clue how to start any help would be much appreciated. In 2-D, read in the initial positions, velocities and masses of two bodies (suns, stars etc) . You will need to define suitable units for…
Ben Burak
  • 3
  • 1
  • 2
-2
votes
1 answer

my rope stretches infinitely when i put an object on it

I have a rope generated by pure code in a script to do a fishing line in unity, the problem here is when i put the fishing buoy on the rope tip, the rope stretches infinitely and i want the buoy hanging, i tried changing the rope length and the…
sergiogix
  • 3
  • 1
-2
votes
1 answer

Draggable blocks with gravity (div with a link)

I need to do a section on a website which contains some draggable "bubbles" and which has a gravity effect and bouncing. This is the reference website https://www.goldinteractive.ch/news, do even know any plugin or any hint to make it? Thank you
Nerd
  • 175
  • 1
  • 3
  • 8
-2
votes
1 answer

How can I code a moving circle according to gravitational acceleration?

New programmer here - Used PsychoPy to generate a circle moving across the screen. Super basic, but I want to simulate different realistic acceleration profiles. Basically I want one of the profiles to be the circle moving at the acceleration of…
-2
votes
1 answer

Wordpress booking form using Gravity forms

I created custom custom post types and fields using Toolset. I have aprox. 500 items and my goal is to create a booking form using Gravity forms and embedd this form using function call. Some fields in the Gravity forms need to be populated from…
-2
votes
2 answers

Why does my my gravity work in this?

http://davzy.com/gameA/ I can't figure out a smart way to get gravity. Now with this it detects which block the character is over but it does't drop to that block! Is there a better way to do gravity? I'd like to do this without a game library.
David Zorychta
  • 13,039
  • 6
  • 45
  • 81
-2
votes
2 answers

is there any way to call a variable from a specific if statement?

ok so I need to make this program that involves the gravity constant. but i let the user decide that double g; String unit; if (n == JOptionPane.YES_OPTION) { g = 9.8; System.out.print(g); unit = "meters/s"; } else { g = 32; …
MinhazMurks
  • 191
  • 1
  • 2
  • 13
-2
votes
1 answer

Unity gravity to specific objects depending on tag

I have a problem. I'm making a game what is a lot depending on gravity. now I want that the player object has a gravity to other objects with a certain tag. It is a 2d game. How can I give the player this kind of gravity? I prefer a c# script, but…
Florian
  • 11
  • 1
1 2 3
55
56