Retry Button

Can any one make a retry button when he lose and score when the sponge bob go to gold +5 in score and when is he fo up +10 pleas pleas pleas any one edit my code pleas

Open this link to down load my code

https://www.dropbox.com/s/8hmd1n7jbt1dmcv/Super%20spongeccode.txt

–# Super_sponge
Girl = class()

function Girl:init() – you can accept and set parameters here
self.position = vec2(0,0)
self.velocity = vec2(0,0)
end

function Girl:jump(power)

       sound(SOUND_JUMP)
sound(DATA, "ZgJAQwBAJFE8dFZiGE9hv5j2Kj+6aI0/VQA5U0JyRyM/KEBC")
sound(DATA, "ZgBAMxhIOUVPThVAP49GPdcp/T7I9gQ/VwAucS9FLUA4M0BY")

sound(DATA, “ZgBASAA2SWE/QARCRDw3v/yitT4NRLw+QABIRmNBQEEZInFs”)
sound(DATA, “ZgBAQQA1USQHPnJHch1oP8oPPD9Un0M/QAA+f0BSRQdAY0t/”)
sound(DATA, “ZgJAJgBAQEBAQEBAAAAAAJqZmT7NzMw+QABAf0BAQEBAQEBA”)

local pow = power
if difficulty == “medium” then pow = pow - 12 end
if difficulty == “hard” then pow = pow - 10 end
self.velocity = self.velocity + vec2(0,pow)
end

function Girl:computeVelocity()
gravity = vec2(Gravity.x, math.min(Gravity.y,1)):normalize()
gravity = gravity * 13
friction = math.min(self.position.y, 1)
return self.velocity + gravity * friction
end

function Girl:update()
self.position = self.position + self:computeVelocity()

self.position.y = math.max(self.position.y,0)


self.position.x = math.max(self.position.x,-WIDTH/2)
self.position.x = math.min(self.position.x,WIDTH/2)


self.velocity = self.velocity * 0.98

end

function Girl:isFalling()

 return self:computeVelocity().y < 0    

end

function Girl:draw()
self:update()
pushMatrix()
translate(self.position.x, self.position.y)

sprite(“Documents:sponge bob”)

end

–# Main

function setup()

– project info

version = 1.0

saveProjectInfo(“Description”, “super sponge game”)
saveProjectInfo(“Author”, “Mohammad abumoosa”)
saveProjectInfo(“Date”, “17st may 2013”)
saveProjectInfo(“Version”, version)

print(“super sponge v”…version…"
")
print(“the developer mohammad abumoosa”)
print("this is the english version for this game ")
print("thank you for downloading the game

Or pleas make a code for score and retry buttoun and iwell put it

Your code doesn’t appear to be all there. Please also read the FAQ on how to format code on the forum.

@Mohammad_abumoosa - so we can read your code, please put three ~ before the code, and three ~ after the code

--# Super_sponge 

Girl = class()


function Girl:init() -- you can accept and set parameters here 

    self.position = vec2(0,0) 

    self.velocity = vec2(0,0) 
end


function Girl:jump(power) 

 
          sound(SOUND_JUMP)

    sound(DATA, "ZgJAQwBAJFE8dFZiGE9hv5j2Kj+6aI0/VQA5U0JyRyM/KEBC")

    sound(DATA, "ZgBAMxhIOUVPThVAP49GPdcp/T7I9gQ/VwAucS9FLUA4M0BY")

   sound(DATA, "ZgBASAA2SWE/QARCRDw3v/yitT4NRLw+QABIRmNBQEEZInFs")

    sound(DATA, "ZgBAQQA1USQHPnJHch1oP8oPPD9Un0M/QAA+f0BSRQdAY0t/")

    sound(DATA, "ZgJAJgBAQEBAQEBAAAAAAJqZmT7NzMw+QABAf0BAQEBAQEBA")
 
   local pow = power

    if difficulty == "medium" then pow = pow - 12 end

    if difficulty == "hard" then pow = pow - 10 end

    self.velocity = self.velocity + vec2(0,pow)

end


function Girl:computeVelocity()

    gravity = vec2(Gravity.x, math.min(Gravity.y,1)):normalize() 

    gravity = gravity * 13

    friction = math.min(self.position.y, 1) 

    return self.velocity + gravity * friction 
end


function Girl:update() 

    self.position = self.position + self:computeVelocity()


    self.position.y = math.max(self.position.y,0)
    


    self.position.x = math.max(self.position.x,-WIDTH/2)

    self.position.x = math.min(self.position.x,WIDTH/2)
    
   
    self.velocity = self.velocity * 0.98
end


function Girl:isFalling() 
   
     return self:computeVelocity().y < 0    

     
end




function Girl:draw()

    self:update()

    pushMatrix()
 
   translate(self.position.x, self.position.y)

sprite("Documents:sponge bob")

end



















--# Main



function setup() 





-- project info


   version = 1.0


   saveProjectInfo("Description", "super sponge game")

   saveProjectInfo("Author", "Mohammad abumoosa")

   saveProjectInfo("Date", "17st may 2013")

   saveProjectInfo("Version", version)
   


   print("super sponge v"..version.."\
")

   print("the developer mohammad abumoosa")

   print("this is the english version for this game ")

   print("thank you for downloading the game  
--# Super_sponge 

Girl = class()


function Girl:init() -- you can accept and set parameters here 

    self.position = vec2(0,0) 

    self.velocity = vec2(0,0) 
end


function Girl:jump(power) 

 
          sound(SOUND_JUMP)

    sound(DATA, "ZgJAQwBAJFE8dFZiGE9hv5j2Kj+6aI0/VQA5U0JyRyM/KEBC")

    sound(DATA, "ZgBAMxhIOUVPThVAP49GPdcp/T7I9gQ/VwAucS9FLUA4M0BY")

   sound(DATA, "ZgBASAA2SWE/QARCRDw3v/yitT4NRLw+QABIRmNBQEEZInFs")

    sound(DATA, "ZgBAQQA1USQHPnJHch1oP8oPPD9Un0M/QAA+f0BSRQdAY0t/")

    sound(DATA, "ZgJAJgBAQEBAQEBAAAAAAJqZmT7NzMw+QABAf0BAQEBAQEBA")
 
   local pow = power

    if difficulty == "medium" then pow = pow - 12 end

    if difficulty == "hard" then pow = pow - 10 end

    self.velocity = self.velocity + vec2(0,pow)

end


function Girl:computeVelocity()

    gravity = vec2(Gravity.x, math.min(Gravity.y,1)):normalize() 

    gravity = gravity * 13

    friction = math.min(self.position.y, 1) 

    return self.velocity + gravity * friction 
end


function Girl:update() 

    self.position = self.position + self:computeVelocity()


    self.position.y = math.max(self.position.y,0)
    


    self.position.x = math.max(self.position.x,-WIDTH/2)

    self.position.x = math.min(self.position.x,WIDTH/2)
    
   
    self.velocity = self.velocity * 0.98
end


function Girl:isFalling() 
   
     return self:computeVelocity().y < 0    

     
end




function Girl:draw()

    self:update()

    pushMatrix()
 
   translate(self.position.x, self.position.y)

sprite("Documents:sponge bob")

end



















--# Main



function setup() 





-- project info


   version = 1.0


   saveProjectInfo("Description", "super sponge game")

   saveProjectInfo("Author", "Mohammad abumoosa")

   saveProjectInfo("Date", "17st may 2013")

   saveProjectInfo("Version", version)
   


   print("super sponge v"..version.."\
")

   print("the developer mohammad abumoosa")

   print("this is the english version for this game ")

   print("thank you for downloading the game  

I ha e put it but the code doesn’t appear

Give me your email and i well send he code to you

Press the link to down load my code

https://www.dropbox.com/s/8hmd1n7jbt1dmcv/Super%20spongeccode.txt

No, only put the ~~~ at where the code you want to format first starts, and where it ends, not in between functions.

Ok help me if you now

Check if the character’s dead, if she is, sprite a retry image in the middle of the screen, in function touched(touch) check if the character is dead and the finger is within the boundaries of the retry button (retry x - (retry width / 2), retry x + (retry width / 2), retry y - (retry height / 2), retry y + (retry height / 2)) and if so, reset the game. You can’t expect a chunk of code to fall into your lap, though.

I can not edit pleas can edit it pleas

Pleas edit it

Just to know: how old are you Mohammed? This could explain that.

It would require a lot of code in a lot of different parts, which makes it hard for me to write you code. Either way, it’s good to code it yourself, get experience, and understand it. Also, I wouldn’t put an app on the App Store with the trademarked Spongebob graphics. Or one very close to an example…

@Jmv38 he’s 12 - http://www.twolivesleft.com/Codea/Talk/discussion/comment/12201#Comment_12201

@Mohammad_abumoosa - I understand you are young and eager but constantly asking for people to write you bits of code to add to your program is going to start to annoy people. @SkyTheCoder has already given you ample help by telling you how to write your button. In addition @ReefWing has an excellent tutorial on buttons here: http://codeatuts.blogspot.com.au/2012/06/tutorial-3-simple-button-class.html - have a go yourself - its the only way you’ll learn. If you have a good go at it but still don’t understand a part of it, ask a specific question about that part of it rather than “write me some code to do x pleas” - you’ll find people are much more willing to help.

Finally, I commend you on your politeness, but please note the spelling of please (pleas is a correctly spelt word so the spell checker won’t catch it)

Ok, now i get it better.
Mohammad, you are young but this is no excuse for being a jerk. You should ask you parents to read you posts and explain you that the way you ask for things is EXTREMELY RUDE and that you have to learn what POLITENESS is. If they however support the way you express youself, then this is hopeless…

I think much of the problem is that his English is not good, so he doesn’t know how to ask.

Looking back, Mohammed has been a member since last July and has been asking similar questions (about Spongebob, yes) periodically, without much success, because his questions are unclear, and he keeps asking us to write chunks of code for him. Either he’s looking for the easy route to fame and fortune, or he’s an eager kid struggling with English as well as programming. I’m not sure what to do in either case, because his English is so poor that I don’t see how he can even understand the code.

I would recommend reading as many books as possible, and asking your parents what words mean when you find one you don’t know. That gets you good grammar.

Shut up all dont talk with me like thes iam 12 years old if you dosnt want to help me …
Dont help me thers 100000000000000000 can help me not 4 bad mans like …
Can you read thes (( dont translate it )) if you are baby you can translate it

??? ??? ??? ??? ??? ??? ??? ???

No one can read this and i am from qatar i am from arabic country