Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
Old
jediaction
Senior Member
 
jediaction's Avatar
 
Status: Offline
Posts: 5,064
Join Date: Jul 2009
Location: Bel Air, Maryland
Default 01-11-2010, 07:49 AM

No i thought of that, just make it so as soon as the turtle is pressed on, it goes showing = false for a split second then it comes back but still moving on the path


Website: www.salokingames.com
FaceBook: www.facebook.com/SalokinGames
   
Reply With Quote
Old
x2495iiii
Super Moderator
 
x2495iiii's Avatar
 
Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
Default 01-11-2010, 08:29 AM

Quote:
Originally Posted by Dameria View Post
It is because you are probably dragging as you click. When you click and drag, and then let go, Alice does not register that as a click. If you keep the mouse still while you click on the moving turtle, it will register.
You can stop this from happening by changing the clicking event to "while the mouse is pressed" and adding the method call (or whatever trigger you used) to the Begin part of the event.


(')>
   
Reply With Quote
Old
jediaction
Senior Member
 
jediaction's Avatar
 
Status: Offline
Posts: 5,064
Join Date: Jul 2009
Location: Bel Air, Maryland
Default 01-11-2010, 08:58 AM

oh, well i dont think i ever tried it, i dont know


Website: www.salokingames.com
FaceBook: www.facebook.com/SalokinGames
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 978
Join Date: Sep 2009
Location: United States
Default 01-11-2010, 02:28 PM

Quote:
Originally Posted by x2495iiii
You can stop this from happening by changing the clicking event to "while the mouse is pressed" and adding the method call (or whatever trigger you used) to the Begin part of the event.
Yea thats a good idea, I thought of that but I didn't try it, I see how it would work though.

Ok I decided I just wanted to fix the glitch and some other memory consuming things in the program. Now, no longer will it be constantly be running from a while loop in the events panel. Ok here it is without the glitch, but I did not add any other levels.
Attached Files
File Type: a2w turtle game1.6.a2w (1.44 MB, 10 views)


Check out my best projects so far and please comment:

Tic-Tac-Toe 2.0 ................... http://www.alice.org/community/showthread.php?t=3548
Alice Paint ........................... http://www.alice.org/community/showthread.php?p=23408
Real-Time Clock .................. http://www.alice.org/community/showthread.php?p=12725
Maze Game ......................... http://www.alice.org/community/showthread.php?t=4301

Last edited by Dameria; 01-11-2010 at 03:05 PM.
   
Reply With Quote
Old
thearun
Guest
 
Status:
Posts: n/a
Default 01-11-2010, 05:59 PM

i didn't know you guys were still working on it:O anywaysss... i decided to post what i have so far. In case you're curious. i have a few more days to complete this, so i'm going to work on my history report and english essay in the meantime. [this can get boring sometimes]
Tell me what you think.
[its not that i need help, just don't feel like putting in the rest of the knives and figuring out why the restart won't work right now.] so u dont hav to do it for me.

BUT, i would like to know why i can't make a copy of the largest if/else statement in turtleMovement. Is it just too big? its gonna be such a pain redoing it for all the levels and,, yes i have though about using a variable for the duration. Would it work if i just changed the if condition to a parameter and executed the method 3 times with a different parameter value?

and yes i started naming the files with version numbers because one time when i was working on it it got corrupt n wudn save so i expported the commands and copied them in a new one making sure to save in different files every so often.
Attached Files
File Type: a2w tgame0.9.a2w (1.46 MB, 7 views)

Last edited by thearun; 01-11-2010 at 06:01 PM.
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 978
Join Date: Sep 2009
Location: United States
Default 01-11-2010, 07:59 PM

Quote:
Originally Posted by thearun View Post
BUT, i would like to know why i can't make a copy of the largest if/else statement in turtleMovement. Is it just too big? its gonna be such a pain redoing it for all the levels and,, yes i have though about using a variable for the duration. Would it work if i just changed the if condition to a parameter and executed the method 3 times with a different parameter value?
I was just about to say "No!! Don't copy and paste that huge if/else statement!" And then I saw that you already know about the variable. What I was thinking is that instead of the if else statement itself being a variable, you can put the speed as a variable. You know, where it says move turtle to knifex duration 0.5 seconds? Maybe instead of 0.5 you could use a number variable that you can change for each level. Maybe for level 1 you can set the variable turtleSpeed to 1 (make sure you have turtleSpeed in each place where duration is for turtle moving to knife), and then when you get 10 hits, the turtleCounter gets reset to 0 in a method that you can make, and in that same method you change turtleSpeed to maybe 0.75. That way you can have multiple levels where the turtle goes at a faster speed.

Or if you want to be even more complex, you can make it so that there are infinite levels, and you would have a levelNum variable, and each level it counts up one of the levelNum, and when turtleCounter goes to 10, it goes to next level, and in the method where the level goes up one, you have a method making turtleSpeed do: "turtleSpeed = (turtleSpeed * 0.8)". That way, each level the turtle would go faster exponentially by 20% each level.

It is hard to explain without doing it for you, do you understand though?


Check out my best projects so far and please comment:

Tic-Tac-Toe 2.0 ................... http://www.alice.org/community/showthread.php?t=3548
Alice Paint ........................... http://www.alice.org/community/showthread.php?p=23408
Real-Time Clock .................. http://www.alice.org/community/showthread.php?p=12725
Maze Game ......................... http://www.alice.org/community/showthread.php?t=4301
   
Reply With Quote
Old
thearun
Guest
 
Status:
Posts: n/a
Default 01-11-2010, 08:01 PM

i do understand. Thanks for your input. I'll work on it some more tomorrow.
   
Reply With Quote
Old
x2495iiii
Super Moderator
 
x2495iiii's Avatar
 
Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
Default 01-11-2010, 08:10 PM

Nice job deciding to work on it on your own thearun. That's pretty rare.

It's pretty funny, though, how jediaction and Dameria got so caught up in doing cool stuff to your world that they sorta missed that. Now THAT'S enthusiasm.


(')>
   
Reply With Quote
Old
thearun
Guest
 
Status:
Posts: n/a
Default 01-11-2010, 08:11 PM

if only i had that much free time
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 978
Join Date: Sep 2009
Location: United States
Default 01-11-2010, 09:06 PM

Yea I actually worked on your program so that the three levels you made are working, increasing the time greatly, making level 3 very challenging. I will not post it though because you want to do it yourself.

Its weird, I don't like making my own games, but I love taking other people games and making them better

One thing I to help you with the other levels though if your wondering why they are not working, look what is defined in the if/else statements with turtleCounter and it watching out to see that it does not go past a certain number.


Check out my best projects so far and please comment:

Tic-Tac-Toe 2.0 ................... http://www.alice.org/community/showthread.php?t=3548
Alice Paint ........................... http://www.alice.org/community/showthread.php?p=23408
Real-Time Clock .................. http://www.alice.org/community/showthread.php?p=12725
Maze Game ......................... http://www.alice.org/community/showthread.php?t=4301
   
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Copyright ©2019, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.