Alice Community

Alice Community (
-   How do I...? (
-   -   help with game (

kris33 11-02-2006 01:06 PM

help with game
I'm new to this forum, and I need a little help...

In my class were were assigned a project to make a game. In mine, I have my main character (who happens to be a penguin), who is trying to defeat other characters (snowmen). First of all, I would like all the controls to be by keyboard. I want the user to be able to type <enter> and do the method for hit (which i already created)...however, I want it so that whichever snowmen he hits, disappears. As of now, when the user hits <enter>, it has to be a specific snowmen. Is there a way to make it be [I]any[/I] of the snowmen...
you know, you approach the first guy, and type <enter>, the penguin hits him, and he disappears. Is this possible, or can I only do it by having the snowmen be clicked on.

I hope this makes sense, and I appreciate any responses!


roofy 11-02-2006 03:46 PM

If I understand you correctly, you want to know if you can create a condition that only checks for the snowmen only.

In this case, the answer is yes, but I have a question for you. Do you have the Learning to Program with Alice book? If so, you can look back at the zues project in both chapter 5 and chapter 6.

Note... after learning the method in chapter 5, the problem you will get is that any object can be clicked on. However, in chapter 6, the book shows you how to resolve that problem from chapter 5. Therefore, I would recommend reading those 2 zues projects from the book, and you will get your answer on how to do what you want your game to do.

Shadow Sovereign 11-03-2006 09:29 PM

I have that project in the classroom, but I'm at home right now. On monday morning, I'll post my Zeus world so you can get an idea of what you need, bud (Assuming you don't have the book!)...

lanceA 11-03-2006 09:42 PM

Yes. Please post your code and your world file.

Shadow Sovereign 11-03-2006 09:47 PM

Will do. In the meantime, I'll try and see if I can get some of these other things done while I'm burnin' off my newly-opened time this weekend... my computer school canceled the LAN party I was going to go to tomorrow. :(

lanceA 11-03-2006 10:17 PM

We like to help others with their homework on this site.

So, as you offered, PLEASE post not only the .A2w but also the code. And if you could, would you mind including comments in your code? It would help others.

gabe 11-04-2006 02:31 AM

Please do not post complete solutions to problems. We would rather have you explain the process of solving a problem and focus on programming concepts or Alice UI things.

All times are GMT -5. The time now is 11:38 PM.

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