I need help with my little Game
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
I need help with my little Game
Hey Livecoders!
I have a Problem
I need you to help me creating a small Game.
GAME EXPLAINED
I want to recreate a modified Version of hau the mole.
By clicking on a Button some Circles start changing there color from Black to red(also at the same or some small time differneces between them). In this time you have to click the square if not you automaticlly will lose.
MY IDEA THAT DIDNT WORK
The problem im dealing with is that i created a method for every single square that tells him to change his color. But when i press the button only one of my circleMethods starts(the first mentioned in the button script) and the others won't. So think that the Button Method waits until the first mentioned method stops, then it goes on to the second method.
WHAT I HOPE GETTING FROM YOUR ANSWERS
Just a solution for my Problem or a complete new Idea for creating that game.
I know my english is very bad but im improving(16 years old)!
Hope you can help me creating this game!
with warm regreeds from Germany!!!!!!
I have a Problem
I need you to help me creating a small Game.
GAME EXPLAINED
I want to recreate a modified Version of hau the mole.
By clicking on a Button some Circles start changing there color from Black to red(also at the same or some small time differneces between them). In this time you have to click the square if not you automaticlly will lose.
MY IDEA THAT DIDNT WORK
The problem im dealing with is that i created a method for every single square that tells him to change his color. But when i press the button only one of my circleMethods starts(the first mentioned in the button script) and the others won't. So think that the Button Method waits until the first mentioned method stops, then it goes on to the second method.
WHAT I HOPE GETTING FROM YOUR ANSWERS
Just a solution for my Problem or a complete new Idea for creating that game.
I know my english is very bad but im improving(16 years old)!
Hope you can help me creating this game!
with warm regreeds from Germany!!!!!!
Last edited by Kiliaan on Fri Jul 21, 2017 1:34 pm, edited 1 time in total.
Re: I need help with my little Game
I think there are a few ways that readily come to mind for changing multiple colors in a quick seeming way.
In the dictionary, check the entry "lockScreen". In essence, this puts the screen in a "hold" mode, while your code, probably in a loop, would change all the colors. Then you simply unlock the screen, and *poof*, your changes are displayed.
A second method that may work, again probably in a loop, would be using "without waiting". Since nothing is actually moving (if I understood your description correctly), the color changes would go off like firecrackers, real fast.
The loop might look something like this:
the pattern used for testing looks like this :
Hope that helps you.
In the dictionary, check the entry "lockScreen". In essence, this puts the screen in a "hold" mode, while your code, probably in a loop, would change all the colors. Then you simply unlock the screen, and *poof*, your changes are displayed.
A second method that may work, again probably in a loop, would be using "without waiting". Since nothing is actually moving (if I understood your description correctly), the color changes would go off like firecrackers, real fast.
The loop might look something like this:
Code: Select all
on mouseUp
repeat with x = 1 to the number of controls
if the backgroundPattern of control x = "" then
set the backgroundPattern of control x to "208007"
else
set the backgroundPattern of control x to ""
end if
end repeat
end mouseUp
Hope that helps you.
-
- VIP Livecode Opensource Backer
- Posts: 9648
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: I need help with my little Game
Hi.
Make four buttons. In the script of the fourth button:
Click the fourth button. If you press the optionKey, the color change will stop/
Craig Newman
Make four buttons. In the script of the fourth button:
Code: Select all
on mouseUp
set the backColor of btn 1 to "0,0,0"
set the backColor of btn 2 to "0,0,0"
set the backColor of btn 3 to "0,0,0"
repeat with y = 1 to 255 step 3
if the optionkey is down then exit to top
repeat with u = 1 to 3
set the backColor of btn u to y & ",0,0"
end repeat
end repeat
end mouseUp
Craig Newman
-
- VIP Livecode Opensource Backer
- Posts: 7228
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: I need help with my little Game
A typical method is:
Lock the screen
Use a repeat loop to return all buttons to their default color
Get a random number and set the backColor of that button to the selected color
Unlock the screen
Locking the screen prevents updates, and this will run very quickly.
Lock the screen
Use a repeat loop to return all buttons to their default color
Get a random number and set the backColor of that button to the selected color
Unlock the screen
Locking the screen prevents updates, and this will run very quickly.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: I need help with my little Game
Thanks for all your Answers!!!
I love how kind the livecode Community is!
I will try all your Solving Ideas!
Thanks again. Have a nice Day.
Kilian
I love how kind the livecode Community is!
I will try all your Solving Ideas!
Thanks again. Have a nice Day.
Kilian
Re: I need help with my little Game
It's easy to do it with livecode, looks what I did for my wife:
My problem is the artificial intelligence, I don't know how set difficulty level after level, my game becomes too fast after some levels.
My problem is the artificial intelligence, I don't know how set difficulty level after level, my game becomes too fast after some levels.
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
Re: I need help with my little Game
Hi MaxV!
This looks like the thing i was looking for!
Can you send me the stack?
Would be cool if you can.
have a nice day Kilian
This looks like the thing i was looking for!
Can you send me the stack?
Would be cool if you can.
have a nice day Kilian
Re: I need help with my little Game
Here is the stack and files
- Attachments
-
- giocoTalpine.zip
- (15.6 KiB) Downloaded 165 times
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
Re: I need help with my little Game
Oh man i love you!
Thats exactly what i was looking for!
Thanks a lot!
greetings from Germany
Thats exactly what i was looking for!
Thanks a lot!
greetings from Germany