Hey help me out with libraries in corona app development as Physics and sprites. Is there any document available to see the functions and their details ? [import]uid: 63289 topic_id: 10315 reply_id: 310315[/import]
huh?
http://developer.anscamobile.com/reference/index/physics-engine
and
http://developer.anscamobile.com/reference/index/sprite
c [import]uid: 24 topic_id: 10315 reply_id: 37642[/import]
Thank you sir…
I am a beginner so please don’t mind,
I tried but i didn’t get those libraries. [import]uid: 63289 topic_id: 10315 reply_id: 37648[/import]
I have added a button to run a character in my game. But it only run once when i press the button. I want it to run until i stop pressing the button, like we have in famous games like mario. You just need to press a forward button to run your character and until you stop pressing your character runs continuously.
[import]uid: 63289 topic_id: 10315 reply_id: 38672[/import]
With the touch event, have a look here:
http://developer.anscamobile.com/reference/index/eventphase-0
What you want to look at is starting the character moving when event.phase=“began” and stop them moving when event.phase=“ended”. You could set a variable to flag whether the character should be moving or not, and actually make them move (character.x = character.x + 1 or similar) in an enterframe event handler:
http://developer.anscamobile.com/content/enterframe [import]uid: 12448 topic_id: 10315 reply_id: 38682[/import]
hey do you know how to stop sprites. In my code when i press a button my character starts run but i am not able to stop it’s moving sprites when i leave the button. I have already tried
spritesInstance:pause() [import]uid: 63289 topic_id: 10315 reply_id: 39282[/import]
1 more thing - I have added some physical bodies in my game and placed them accordingly. If i use “static” then these works properly but as i use “dynamic” they starts moving randomly.
I know in “dynamic” there is effect of gravity but i used physics.setGravity(0,0) but still they are moving randomly in x direction. [import]uid: 63289 topic_id: 10315 reply_id: 39283[/import]
how to add a infinite loop in a code ?
i have tried this–>
local i
for i = 1, “”, 1 do
but is not working. [import]uid: 63289 topic_id: 10315 reply_id: 39597[/import]
while true do
end
---------------- and while you are at it? why would you want to add an infinite loop?
c [import]uid: 24 topic_id: 10315 reply_id: 39640[/import]
Sir i want my character to run and increase speed gradually so when i press a button it start walking and it’s speed increase until i stop pressing the button. [import]uid: 63289 topic_id: 10315 reply_id: 39660[/import]
i have used this code for a sprite sheet
local sheet1 = sprite.newSpriteSheet( “man.png”, 128, 128 )
local spriteSet1 = sprite.newSpriteSet(sheet1, 1, 8)
sprite.add( spriteSet1, “move”, 1, 8, 1000, 0 )
sprite.add( spriteSet1, “run” ,1,8,400,0)
sprite.add( spriteSet1, “back” ,9,7,400,0)
local instance1 = sprite.newSprite( spriteSet1 )
instance1.x = 50
instance1.y = baseline-50
instance1.xScale = .3
instance1.yScale = .3
physics.addBody( instance1,{ friction=0.5 } )
but when i run my game it is not working properly because it takes size of each sprite as the whole sprite image size. I mean for example let my sprite image is 1024x1024 and each image is 128x128, in my case it’s content image size is 128x128 but the image is 1024x1024…so when i add physics in my game my sprite cann’t move further without touch in the next cart. [import]uid: 63289 topic_id: 10315 reply_id: 39739[/import]
I want to add buttons from keybored to perform action. I have added some buttons but i also want these buttons to run when i press a key from keybored. For example i want my character to run when i press “D” button. [import]uid: 63289 topic_id: 10315 reply_id: 39746[/import]
hey,
i want an image will appear when i press a button but then it should also disappear in 10 seconds.I mean image should be their only for 10 seconds.
Help me out ?? [import]uid: 63289 topic_id: 10315 reply_id: 42057[/import]
Take a look at timer.performWithDelay() –
http://developer.anscamobile.com/reference/index/timerperformwithdelay
You can specify a function to be called after 10 seconds and that function could remove your image.
Jay
[import]uid: 9440 topic_id: 10315 reply_id: 42066[/import]
hey budy thanx a lot… it is working.
i just need one more help, i have developed a game on corona on windows XP. now i want to test it on Ipod(Ios) so how should i import or transfer the code. [import]uid: 63289 topic_id: 10315 reply_id: 42601[/import]