Alice Community  

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

Reply
 
Thread Tools Display Modes
Initial objects via user input?
Old
bkk
Guest
 
Status:
Posts: n/a
Default Initial objects via user input? - 12-27-2009, 12:45 PM

Hello all...this *should* be simple, but I think I'm missing something very obvious...

I ask for user input at the start of a game as to how many asteroids they can handle at once (max 4)...

What I want to happen is to tell the items in the list to go invisible if they're not needed...

For example, if the user enters "3", then I want the last object in the list to go invisible...if they enter "2", then I want the last two objects, etc...

Must have drunk too much eggnog, because it's not coming easily to me...I've attached a screenshot of the method in question...

TIA!

:-)
Attached Images
File Type: jpg Capture.jpg (81.7 KB, 14 views)
   
Reply With Quote
Old
zarfang8
Guest
 
Status:
Posts: n/a
Default 12-27-2009, 01:36 PM

If your number variable equals 1, asteroid 2 set is showing=false asteroid 3 set is showing=false asteroid 4 set is showing=false

If your number variable equals 2, asteroid 3 set is showing=false asteroid 4 set is showing=false

If your number variable equals 3, asteroid 4 set is showing=false

If you're number variable equals 4, do nothing.

But all these if elses next to each other, and at the bottom of them, Insert a method starting the game.
   
Reply With Quote
Old
bkk
Guest
 
Status:
Posts: n/a
Default 12-27-2009, 01:56 PM

Thanks...I had thought of that, but had hoped there was a more elegant way of driving it. I appreciate you replying...

:-)

brian
   
Reply With Quote
Reply

Tags
user input object list

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 ©2023, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.