course work

elp, I have a file score and coin, I want to make sure that I have mentioned coins can be spent during the game using two buttons to speed up and buy healt clicking which, if all three lives intact, the action is not performed and when you press speed up, it increases the speed of movement p.s. please help time is running out and I am zero in programming. Thank you in advance

I understand that you are running out of time, but take the time to clearly explain your issue and what you have.

Is score a file? If not, what is file score? Is it a score within a file? Is the coin there as well? etc. etc.

I am very much against doing other people’s homework, but it sounds to me like you just need to:

  1. Create a button
  2. Create a function that is called called when the button is pressed
  3. In that function check if number of lives is 3 (i.e. the max number of lives)
  4. If lives are maxed, then do nothing, otherwise reduce the number of lives by one (i.e. do whatever you need to do here)
    (and follow the same example for the other button)

Have a look at https://docs.coronalabs.com/api/library/widget/newButton.html#examples

 

@xedur that is not going to be enough. He is running out of time and he knows 0 about programming. Why don’t you help out and write some code.^

@agramonte, you could have written some code while you were at it as well, but neither one of us did. I also don’t believe that it would help the person asking for help if I wrote a function:
 

local function increaseSpeed( event ) if event.phase == "ended" then speed = speed+1 end return true end

What is speed? Is it just a variable holding a number, as assumed in this function? Should there be a cap? Is there an actual game with moving objects that are supposed to begin moving faster as the speed goes up? etc. etc. There are just way too many things to consider.

For anyone asking for help, the very least that they can do is ask a better question so that people can more easily understand them and therefore actually helping them (see https://forums.coronalabs.com/topic/55780-ask-a-better-question-get-a-better-answer/).

As someone who gives lectures on business mathematics and statistics at a university on the side, I am all for asking questions and I encourage it. However, the question should be something that can be answered without making a number of assumptions. Also, there’s part of the why, as a visiting university lecturer, I don’t enjoy doing someone else’s coursework, especially if they leave it to the last moment :smiley: I’m all for helping people, but everyone needs to take some responsibility. Why enroll on a (game) programming course if you aren’t planning on learning how to write code? :stuck_out_tongue: Just my two cents.

ps. I don’t want to discourage anyone from asking questions. Just make it as easy as possible for others to help you.

thank you all for your help and advice. I really appreciate it and will describe in their work a good forum and make it one of the main advantages

I understand that you are running out of time, but take the time to clearly explain your issue and what you have.

Is score a file? If not, what is file score? Is it a score within a file? Is the coin there as well? etc. etc.

I am very much against doing other people’s homework, but it sounds to me like you just need to:

  1. Create a button
  2. Create a function that is called called when the button is pressed
  3. In that function check if number of lives is 3 (i.e. the max number of lives)
  4. If lives are maxed, then do nothing, otherwise reduce the number of lives by one (i.e. do whatever you need to do here)
    (and follow the same example for the other button)

Have a look at https://docs.coronalabs.com/api/library/widget/newButton.html#examples

 

@xedur that is not going to be enough. He is running out of time and he knows 0 about programming. Why don’t you help out and write some code.^

@agramonte, you could have written some code while you were at it as well, but neither one of us did. I also don’t believe that it would help the person asking for help if I wrote a function:
 

local function increaseSpeed( event ) if event.phase == "ended" then speed = speed+1 end return true end

What is speed? Is it just a variable holding a number, as assumed in this function? Should there be a cap? Is there an actual game with moving objects that are supposed to begin moving faster as the speed goes up? etc. etc. There are just way too many things to consider.

For anyone asking for help, the very least that they can do is ask a better question so that people can more easily understand them and therefore actually helping them (see https://forums.coronalabs.com/topic/55780-ask-a-better-question-get-a-better-answer/).

As someone who gives lectures on business mathematics and statistics at a university on the side, I am all for asking questions and I encourage it. However, the question should be something that can be answered without making a number of assumptions. Also, there’s part of the why, as a visiting university lecturer, I don’t enjoy doing someone else’s coursework, especially if they leave it to the last moment :smiley: I’m all for helping people, but everyone needs to take some responsibility. Why enroll on a (game) programming course if you aren’t planning on learning how to write code? :stuck_out_tongue: Just my two cents.

ps. I don’t want to discourage anyone from asking questions. Just make it as easy as possible for others to help you.

thank you all for your help and advice. I really appreciate it and will describe in their work a good forum and make it one of the main advantages