I'm making a dice game
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Posts: 10
- Joined: Sun Apr 26, 2015 7:14 pm
I'm making a dice game
I'm making a dice game
It's a game in which two teams, A and B, move forward on the horse's board according to the dice score. And the dice are directly thrown by hand, and the horses are controlled on the monitor of a mobile screen, and the horses is controlled by the score by throwing the dice out of the monitor of a mobile, and if it's 3 points, then the user tab 3 times on the horse then the horse moves to 3 points ahead on the board, and if it's 5 points, then the user tab on the horse then the horse moves to 5 points ahead,
But I'm asking for help because it's hard to write a script for this, 1 time tap(click) is easy but 2~5 times tap(click) is hard script to me,
I know there is a pull-down menu once you click on a horse, so you can move the horse forward depending on the selection of pulldown menu from 1 point to 5 point. but I heard that the pull-down menu is not supported on the mobile, because it is produced as an Android mobile game, but I want one of the two ways anyway Is there anyone who can help me? thanks
It's a game in which two teams, A and B, move forward on the horse's board according to the dice score. And the dice are directly thrown by hand, and the horses are controlled on the monitor of a mobile screen, and the horses is controlled by the score by throwing the dice out of the monitor of a mobile, and if it's 3 points, then the user tab 3 times on the horse then the horse moves to 3 points ahead on the board, and if it's 5 points, then the user tab on the horse then the horse moves to 5 points ahead,
But I'm asking for help because it's hard to write a script for this, 1 time tap(click) is easy but 2~5 times tap(click) is hard script to me,
I know there is a pull-down menu once you click on a horse, so you can move the horse forward depending on the selection of pulldown menu from 1 point to 5 point. but I heard that the pull-down menu is not supported on the mobile, because it is produced as an Android mobile game, but I want one of the two ways anyway Is there anyone who can help me? thanks
Last edited by kim yongsun on Thu Mar 30, 2023 3:46 pm, edited 3 times in total.
-
- Livecode Opensource Backer
- Posts: 9385
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: I'm making a dice game
Without a picture of what you want to make it is very difficult to understand.
-
-
-
- VIP Livecode Opensource Backer
- Posts: 9662
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: I'm making a dice game
Hi.
Do I understand that you want to be able for your app to detect the number of times the user clicks, and to then do something with that information? If so, that is very hard to do even in the IDE on desktop. There is a method that I used 30 years ago:
But this is hard to implement beyond two clicks, and I think on mobile it is impossible.
But what to you mean by "tab on a horse"? I assume you mean "click" on a horse. But then what is the problem? The user throws a three, and then clicks on a horse three times. Each time the horse moves a certain distance. What am I missing?
Craig
Do I understand that you want to be able for your app to detect the number of times the user clicks, and to then do something with that information? If so, that is very hard to do even in the IDE on desktop. There is a method that I used 30 years ago:
Code: Select all
on mouseUp
wait 20
if the mouseClick then answer "Two Clicks"
else answer "One Click"
end mouseUp
But what to you mean by "tab on a horse"? I assume you mean "click" on a horse. But then what is the problem? The user throws a three, and then clicks on a horse three times. Each time the horse moves a certain distance. What am I missing?
Craig
-
- Posts: 10
- Joined: Sun Apr 26, 2015 7:14 pm
Re: I'm making a dice game
thank you for your answer!
is it hard?
i want a horse that advances by the number of times I click, that is, a horse that goes to a place corresponding to that value if I click 5 times.
this is a script made by chatGPT
but did not work.
on mouseUp
put movePiece(my currentPosition, the number of clicks of me) into my currentPosition
set the location of me to point my currentPosition of the points of my team
end mouseUp
on movePiece pPiece, pClicks
repeat pClicks times
add 1 to pPiece
if pPiece > 5 then
set pPiece to 1
end if
end repeat
return pPiece
end movePiece
is it hard?
i want a horse that advances by the number of times I click, that is, a horse that goes to a place corresponding to that value if I click 5 times.
this is a script made by chatGPT
but did not work.
on mouseUp
put movePiece(my currentPosition, the number of clicks of me) into my currentPosition
set the location of me to point my currentPosition of the points of my team
end mouseUp
on movePiece pPiece, pClicks
repeat pClicks times
add 1 to pPiece
if pPiece > 5 then
set pPiece to 1
end if
end repeat
return pPiece
end movePiece
-
- VIP Livecode Opensource Backer
- Posts: 9662
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: I'm making a dice game
Kim.
First off, please put all scripts into their tags "</>".
Second, I would learn LiveCode before I started trying to let ChatGPT do my work. That said, how much LC do you know? I cannot help you without that information.
Craig
First off, please put all scripts into their tags "</>".
Second, I would learn LiveCode before I started trying to let ChatGPT do my work. That said, how much LC do you know? I cannot help you without that information.
Craig
-
- Posts: 10
- Joined: Sun Apr 26, 2015 7:14 pm
Re: I'm making a dice game
hi
I know liveCode a little
I used hyperCard long ago and knew liveCode based hypercard,
At that time, I wanted to learn livecode and to make a app.
but it is hard to me, I speak english not well
now I am learning liveCode from chatGPT,
chatGPT was knowing liveCode well,
We talk in Korean about liveCode coding,
But I couldn't solve the same problem as now, so I'm asking here
in my poor English skills. I developed an English word learning application with live code a few years ago and gave up in the last process. The word reading function didn't work on Android text to speech The function was not supported by liveCode. I gave up then and bought a license again these days to develop and learn a dice game, but it's not easy.
I know liveCode a little
I used hyperCard long ago and knew liveCode based hypercard,
At that time, I wanted to learn livecode and to make a app.
but it is hard to me, I speak english not well
now I am learning liveCode from chatGPT,
chatGPT was knowing liveCode well,
We talk in Korean about liveCode coding,
But I couldn't solve the same problem as now, so I'm asking here
in my poor English skills. I developed an English word learning application with live code a few years ago and gave up in the last process. The word reading function didn't work on Android text to speech The function was not supported by liveCode. I gave up then and bought a license again these days to develop and learn a dice game, but it's not easy.
Re: I'm making a dice game
안녕하세요 김
(Thanks to Google)
포럼에 오신 것을 환영합니다
welcome to the forum!
I noticed a little error in your script:
Best
Klaus
(Thanks to Google)
포럼에 오신 것을 환영합니다
welcome to the forum!
I noticed a little error in your script:
Code: Select all
on movePiece pPiece, pClicks
repeat pClicks times
add 1 to pPiece
if pPiece > 5 then
## set pPiece to 1
## This is not BASIC! :-D
## This will do in LC:
put 1 into pPiece
end if
end repeat
return pPiece
end movePiece
Klaus
-
- VIP Livecode Opensource Backer
- Posts: 7235
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: I'm making a dice game
당신의 결단력에 감탄합니다.
I admire your determination.
ChatGPT is not skilled in LiveCode coding, it is better to learn it here. You said the dice was thrown by the user, outside the app. If so, then the user knows the number of moves and only needs to click the horse the same number of times. (This is what Dunbar said.) So if the dice say 5, then the user clicks 5 times. Your mouseUp handler moves the horse each time.
If you want the computer to calculate the dice, it must create a random number from 2 to 12 and then use that number to move the horse. This example is for 2 six-sided dice:
The moveHorse handler is the one you already wrote, it moves the horse 1 square. Or you can replace "moveHorse" with the same commands inside this handler.
도움이 더 필요하시면 저희에게 알려주십시오.
If you need more help, let us know.
I admire your determination.
ChatGPT is not skilled in LiveCode coding, it is better to learn it here. You said the dice was thrown by the user, outside the app. If so, then the user knows the number of moves and only needs to click the horse the same number of times. (This is what Dunbar said.) So if the dice say 5, then the user clicks 5 times. Your mouseUp handler moves the horse each time.
If you want the computer to calculate the dice, it must create a random number from 2 to 12 and then use that number to move the horse. This example is for 2 six-sided dice:
Code: Select all
on mouseUp
put random(11)+1 into tMoves -- for one dice, use random(6)
repeat tMoves times
moveHorse -- rename the mouseUp handler you already wrote
end repeat
end mouseUp
도움이 더 필요하시면 저희에게 알려주십시오.
If you need more help, let us know.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- VIP Livecode Opensource Backer
- Posts: 9662
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: I'm making a dice game
Kim.
Me too.
Play with this stack. It has scripts in the two buttons and on the horse image. Please examine these. I tried to make the stack easy to understand.
This is how you start, with a simple foundation, and then build on that.
Craig
Me too.
Play with this stack. It has scripts in the two buttons and on the horse image. Please examine these. I tried to make the stack easy to understand.
This is how you start, with a simple foundation, and then build on that.
Craig
-
- Posts: 10
- Joined: Sun Apr 26, 2015 7:14 pm
Re: I'm making a dice game
Thanks to all of you!! I will do as you told me. thanks ~
-
- Livecode Opensource Backer
- Posts: 9385
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: I'm making a dice game
I don't think you need artificial intelligence for this bit:
- -
- -
- Attachments
-
- Chuck-A-Luck.livecode.zip
- Stack.
- (50.04 KiB) Downloaded 43 times
-
- Livecode Opensource Backer
- Posts: 9385
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: I'm making a dice game
Well, this took me 15 minutes, and about half of that time was spent messing around with the images.
- -
Now, with a bit of thinking it should be extremely easy to combine those 2 stacks.
- -
Now, with a bit of thinking it should be extremely easy to combine those 2 stacks.
- Attachments
-
- Epsom Downs.livecode.zip
- Stack.
- (31.3 KiB) Downloaded 48 times