Alice Community  

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

Reply
 
Thread Tools Display Modes
Help. Overly complicated game using arrays - mouse move event issues...
Old
todd0312
Member
 
todd0312's Avatar
 
Status: Offline
Posts: 35
Join Date: Sep 2011
Angry Help. Overly complicated game using arrays - mouse move event issues... - 11-16-2011, 05:15 AM

Hello:

I am having a lot of problems with a game where I use a mouse event to move a cone to catch toruses falling from the sky. I am using arrays, and I know there must be a simpler way to do this.

I have tried creating a number of different arrays, but I ran into problems with my mouse event and my indexes (indices?) when I did that. There must be a MUCH simpler way to code this.

I have attached the file.

Here are my issues:
1. Using my laptop, If I am don't keep touching the cone the entire game, sometimes I lose the ability to move it at all (if I let go).
2. The toruses fall in "all together" blocks, but you are not given credit for a catch (the cone changes color and a sound is played when this happens) until all of the toruses (falling at different speeds) have landed. If you catch the first one to land, you have to wait around until they all land before the "catch method" is initiated. There is only one sound when a ring is missed, but I can't get it to initialize "as" a torus lands. It has to wait for the rest. Everything is completely linear.
3. Because of the conditions I have set, not all toruses are capable of incrementing the count. For example, I have a "while count = 5 or count = 6" loop in which three rings fall. Because of the conditions, only 2 can garner points (You may have to look at it to see what I mean). There must be a better way to set up the conditions. I couldn't figure out a better way...
4. When I imported sounds, some worked fine (all mp3); others stopped the loops in their tracks.
5. If you release the mouse from the cone, and then try to grab it while a song is playing, the mouse event often fails to work (pounded this new version of the project out as quickly as possible, so didn't test it a lot).

Thanks in advance.

Todd
Attached Files
File Type: a2w catch the torus.a2w (2.83 MB, 26 views)

Last edited by todd0312; 11-16-2011 at 08:09 AM. Reason: forgot attachment
   
Reply With Quote
Old
dakota95
Senior Member
 
dakota95's Avatar
 
Status: Offline
Posts: 426
Join Date: Aug 2011
Location: like I would tell you. ;)
Cool 11-16-2011, 12:38 PM

are you having trouble with the mouse, or the arrays? If it is the moving of the cone you could just set up keys to move it left and right.
   
Reply With Quote
The main problem is the mouse event - prob. inefficient use of arrays causing
Old
todd0312
Member
 
todd0312's Avatar
 
Status: Offline
Posts: 35
Join Date: Sep 2011
Default The main problem is the mouse event - prob. inefficient use of arrays causing - 11-16-2011, 02:25 PM

Hey - thanks for replying:

The main problem I am having is with the mouse event. I think it is "probably" because of the way that I have structured the code. I'm new to Alice - and to programming. I have some nested do-together blocks inside of loops that may be causing me some problems. During some of those areas of the program, the mouse event moving the cone becomes paralyzed, unless I don't release the mouse from beginning to end in the game.

Part of the issue may also be that I am using a lot of sound effects. I haven't figured out if that is the problem for sure - or not. Removing some of the sounds has not decreased the file size, which I thought was odd, but it has made the mouse event operable a higher percentage of the time.

This is my first time using arrays - and it's the way that I have handled them that used them within the code that makes me wonder - there has to be a better way to be doing this? It seems like my solutions are very inefficient.

Have you had a chance to look at the program? I have another post about the same thing in "shared worlds" that works a little bit better after just removing the opening and ending sounds, which are pretty long.

Thanks for the reply.

Any input - appreciated.

Thanks,

Todd
   
Reply With Quote
Old
sfunk
Senior Member
 
sfunk's Avatar
 
Status: Offline
Posts: 1,112
Join Date: Mar 2011
Location: I don't know
Default 11-17-2011, 06:44 AM

One of the ways I could see working is just making a separate method for each ring declaring whether or not if it is caught, and im not really sure what else to say, I would work on something to try it out myself but I don't have much time these next few days, sorry


If you are stuck on a project, check out the tutorials I made here at this link:

http://alice.org/community/showthread.php?p=36778#post36778

There are lots of tutorials on it so far, including some youtube videos, check it out

Or..

Go to my youtube channel to check out my alice 2.2 tutorials I have there..

http://www.youtube.com/user/sfunk1992?feature=mhsn
   
Reply With Quote
Old
dakota95
Senior Member
 
dakota95's Avatar
 
Status: Offline
Posts: 426
Join Date: Aug 2011
Location: like I would tell you. ;)
Cool 11-17-2011, 12:28 PM

I'm on a tablet for most of my school so I haven't had a chance to download it yet
   
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 ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.