Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

course work
Started by revoded May 28 2019 03:16 PM

4 replies to this topic
help
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

revoded

[GLOBAL: userInfoPane.html]
revoded
  • Observer

  • 3 posts
  • Corona SDK

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



[TOPIC: post.html]
#2

XeduR @Spyric

[GLOBAL: userInfoPane.html]
XeduR @Spyric
  • Contributor

  • 897 posts
  • Corona SDK

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

 



[TOPIC: post.html]
#3

agramonte

[GLOBAL: userInfoPane.html]
agramonte
  • Corona Geek

  • 1,222 posts
  • Corona SDK

@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.^



[TOPIC: post.html]
#4

XeduR @Spyric

[GLOBAL: userInfoPane.html]
XeduR @Spyric
  • Contributor

  • 897 posts
  • Corona SDK

@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 :D 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? :P 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.



[TOPIC: post.html]
#5

revoded

[GLOBAL: userInfoPane.html]
revoded
  • Observer

  • 3 posts
  • Corona SDK

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




[topic_controls]
[/topic_controls]

Also tagged with one or more of these keywords: help