electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
 Forum index » DIY Hardware and Software » ChucK programming language
Holodeck Phaser Practice
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 1 [4 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 6221
Location: near Austin, Tx, USA
Audio files: 267

PostPosted: Fri May 27, 2011 8:16 pm    Post subject: Holodeck Phaser Practice
Subject description: ChucK Style
Reply with quote  Mark this post and the followings unread

Here is another fun application that I wrote for anyone who has a Gyration Air Mouse Elite or similar 3D pointing device. It mimics the holodeck phaser practice program as shown on Star Trek Next Generation.

When you start the program you hear a tone. Once the mouse moves even a tiny bit the tone changes and the game is active. The first target is at (Theta, Phi) = (0, 0), or in other words you are already pointing straight at it, so press mouse button 2 (the wheel) for a free point. You hear a short burst of noise indicating target destruction followed by a quick little beep indicating a score of 1, and the console window also indicates your score.

Immediately after that you hear a different tone as the target has moved to some other location. Hold the mouse at arm's length and rotate it horizontally (Theta) and vertically (Phi), listening to the tone change as you move. The tone reaches a high pitch when you are on-target, then press the button 2 again for another score.

Continue shooting to your heart's content or until the game messes up, which happens. I need to examine the limit conditionals for Theta and Phi (especially Phi) to fix this. For the time being the target locations are restricted to a square cone in front of you. Later when it works better I will put the targets anywhere in a sphere around you.

Also planned for future work (soon) are increasing skill levels in which the target gets smaller, begins to move, gets faster, and sounds different. Maybe I'll add some recorded samples of myself saying things to guide your aim. There is nothing on the screen to watch and there is no stereo imaging, just the change in pitch to guide you. Also the pitch is a function of angular distance, or arc, and does not have Theta and Phi distinctions.

I wrote this game to create an exercise routine that I would personally enjoy. I'm working on GOoCh-ing my way to better physical condition (GOoCh = Get Out of Chair). Anything that gets my fat butt out of this chair is a good thing, and this game has the potential to be really fun. Enjoy!

Les


shooter1.ck
 Description:
version 1, a bit crude but works OK

Download (listen)
 Filename:  shooter1.ck
 Filesize:  5 KB
 Downloaded:  364 Time(s)


_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 6221
Location: near Austin, Tx, USA
Audio files: 267

PostPosted: Fri Jun 03, 2011 3:23 am    Post subject: Reply with quote  Mark this post and the followings unread

Well, I see that version 1 has 10 downloads at this time, so at least a few people have an interest in the program. Early this morning I got up and had a little phaser practice, refining the program along the way. This version has a lot of playability changes that make it more interesting.

Now the target size reduces with score. Target is still fixed in location, but gets smaller. This means that higher score targets have a higher pitch when properly aimed, a happy coincidence of the way it is coded.

Also if you miss, you lose a point and of course you still gain a point for a hit. This means that when you get to your actual level of skill you will tend to stay within a point or two of that skill level. My skill level is about 5, varying from 4 to 6 so I'll call it 5. So that's the score to crush!

Another change is that you fire by moving the mouse wheel one increment, either up or down. I did this because I found that as I play, the mouse behaves both as game input and as an actual mouse. This causes a problem as the middle mouse button does things like launch applications unexpectedly on my Mac's operating system - not good at all. So I made a middle mouse rotation do the firing job. If anyone has trouble with that just let me know and I will fix it.

Also I'm not sure if I mentioned it before, and it's worth repeating: pressing the left mouse button (button 0) resets the origin of phaserTheta and phaserPhi. This is really handy sometimes if you're playing while sitting in a chair.

Oh, and another change is that the target now can appear anywhere around you. The phaser's Theta and Phi are both constrained to a value of -pi to pi, which is a bit funny as the target distance only works for Phi from -pi/2 to pi/2. In other words the wraparound bug is better but still not completely fixed for phi. The bug is gone for Theta though, or never was I think. I'm not quite sure how to fully fix this, but you can always press the left mouse button if you get lost and there's no time constraint to the game so relax. No pressure, no worries!

Actually ChucK's mouse routine seems to be a bit limited in that it cannot access the three programmable buttons (presumably numbered above 2 as 3, 4, and 5). ChucK also cannot access the three-axis accelerometer which is not a problem for this game but would be really nice for other purposes. Hopefully a future version of ChucK will have these features, but it's OK we can do a lot with things the way they are.

Happy target hunting!

Les


shooter3.ck
 Description:
Version 3 of shooter!

Download (listen)
 Filename:  shooter3.ck
 Filesize:  5.72 KB
 Downloaded:  398 Time(s)


_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 6221
Location: near Austin, Tx, USA
Audio files: 267

PostPosted: Fri Jun 03, 2011 4:36 am    Post subject: Reply with quote  Mark this post and the followings unread

Correction: with version 3 my high score is 4.

Les

_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 6221
Location: near Austin, Tx, USA
Audio files: 267

PostPosted: Sat Jun 04, 2011 9:34 pm    Post subject: Reply with quote  Mark this post and the followings unread

Here is version 4 with some minor playability improvements. Have fun!

Les


shooter4.ck
 Description:
version 4 o shooter

Download (listen)
 Filename:  shooter4.ck
 Filesize:  5.62 KB
 Downloaded:  342 Time(s)


_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 1 [4 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software » ChucK programming language
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use