Ok so i am trying to get an image to fall from the top, outside of the screen; so like above the screen so you cant see it. And i want it go from there to outside the bottom; so below the screen. And the problem i am having is i cant figure out how to do it, i have searched it, read the resources and i cant figure it out. If someone could link me to a tutorial or help me out with the code i would greatly appreciate it.
Label: corona android iphone ipad building error inmobi problem display screen View image tableView failed object physics touch button game lua config event listener |
Help with physics.
oops i accidentally posted another one of these too.
Hey there, here's a basic example;
1 2 3 4 5 6 | require ( "physics" ) physics.start() physics.setGravity( 0, 7.5 ) local circle = display.newCircle( 160, -100, 30 ) physics.addBody(circle, "dynamic") |
OK thank you for that, but also how would i make it go like randomly and have more than one? Kind of like a snow flake effect type thing.
Yay i seem to have gotten it they way i wanted it by using the code you gave me (thank you) and adding some more and modifying the one you gave me. Here is the code i am using at the moment:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | local physics = require("physics"); physics.start(); require ( "physics" ) physics.start() physics.setGravity( 0, 7.5 ) local function spawnCircle() local Circle = display.newCircle( 160, -100, 30 ) Circle:setReferencePoint(display.TopReferencePoint); physics.addBody(Circle, "dynamic") end tmr = timer.performWithDelay(100, spawnCircle, 400); |
This is good but you should also make sure you get rid of the objects - otherwise they fall off the screen and keep going ;)
You could put a "floor" below where you can on the screen and then on collision remove the snowflakes.
Peach :)
Yes good suggestion thank you, i was just a few minutes ago when i ran it noticed that they kept going down and made the animation very laggy i will go do that now, thanks.
No worries, Corona for Newbies Part 4 has a tutorial on collision detection if you need it; http://techority.com/2011/06/19/corona-for-newbies-part-4-physics/
Peach :)
send message and call to a person
Forum: Report Spam + PM
[INSTALL_PARSE_FAILED_NO_CERTIFICATES]
[SOLVED] Director ERROR: Failed to execute new( params ) function on 'screen1'
Too many (200) local variables
Corona SVG Level Builder released. Drag and drop physics level editor with Inkscape and SVG.
Small bug in Collectible Items example
Pivot Joints and apparent elasticity
Can't make removeSelf() delayed
Screen flashing on scene change
OOP - error using display group as container object? - object:insert(sprite) fails
New Corona SDK Release!
"Gates" or Doors
math.random
audio.stop() and scratchy sounds
How to remove lines around sprites exported from Spriteloq
Kunundrum is live!
Director Class Error when selecting picture from library.