Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Need Some Programming Help  (Read 860 times)

praguepride

  • Bay Watcher
  • DF is serious business!
    • View Profile
Need Some Programming Help
« on: March 09, 2010, 11:18:48 pm »

I'm planning on running a game at GenCon in August and I could use somebody's help out there.

What I need is a simple program that can run off of a crappy XP laptop that does the following:

1: Display a text box that prompts for a password and does a simple mask that turns characters inputted into *'s

Note: There is no verification or character scrubbing or "correct" password.

2: No matter what is inputted into the text field, when the enter button is pressed, a countdown timer appears in big red letters, counting down from 10:00 minutes.

Note: Bonus points if after the first minute a warning siren starts up. It is critical that if an audio component is used that it doesn't start immediately, only after the first minute.

And that's it. When the countdown reaches 0 the program terminates and that's that.

If it helps, I could probably dig up a .wav file to play the warning siren. Hopefully it'd be something really easy for someone to do. Unfortunately my only programming experience is with web-based applications and I don't have internet access on this laptop.

If someone could help me out that would be awesome!
Logged
Man, dwarves are such a**holes!

Even automatic genocide would be a better approach

Dasleah

  • Bay Watcher
    • View Profile
Re: Need Some Programming Help
« Reply #1 on: March 10, 2010, 12:44:10 am »

Easily done with a little HTML (for the page that requires the password input box - this is a native feature of forms) and Javascript (for the 10-minute countdown timer and sound)
Logged
Pokethulhu Orange: UPDATE 25
The Roguelike Development Megathread.

As well, all the posts i've seen you make are flame posts, barely if at all constructive.

praguepride

  • Bay Watcher
  • DF is serious business!
    • View Profile
Re: Need Some Programming Help
« Reply #2 on: March 10, 2010, 10:21:02 am »

You're right, I don't need internet. I just really suck at JSP and haven't used it in 5 years...

If anyone is willing to help, that'd be awesome, otherwise I might be able to handle this on my own...
Logged
Man, dwarves are such a**holes!

Even automatic genocide would be a better approach

eerr

  • Bay Watcher
    • View Profile
Re: Need Some Programming Help
« Reply #3 on: March 11, 2010, 02:55:41 pm »

Well I have no idea What to do either, but It sounds like a CGI script, or some sort of loaded script.

Would probably be too obvious in flash though.


Couldn't they just exit the file by clicking a button?

Now in the other Java language, I think you can probably supress the exit button for a JFrame somehow(Lock it up in a loop?). And then leave the update code in a seperate thread.

But Java sucks for sounds and images though.
Logged

praguepride

  • Bay Watcher
  • DF is serious business!
    • View Profile
Re: Need Some Programming Help
« Reply #4 on: March 16, 2010, 11:51:21 am »

I think I'll just tell them "no clicking 'X' or ctrl+alt+del or anything"

It's supposed to be part of game where I'm face-to-face, hence why it doesn't actually ahve to do anything as the impact of them failing to "disarm" the timer would be addressed by me, physically.

The same effect could be created with a simple stopwatch, I know, but I'd like there to be a little production value to it. Big red timer that is blaring an alarm is much more impactful then me hitting a stop watch...
Logged
Man, dwarves are such a**holes!

Even automatic genocide would be a better approach

Eagleon

  • Bay Watcher
    • View Profile
    • Soundcloud
Re: Need Some Programming Help
« Reply #5 on: March 16, 2010, 02:00:25 pm »

Here you go
http://dl.dropbox.com/u/80683/Count.zip
and
http://dl.dropbox.com/u/80683/CountSolution.zip if you're paranoid and want to build it yourself (VB 2008)
The wav file needs to be named alarm.wav, but you can change it to anything you like.

It was close enough to something I had already done, a small alarm clock app :P
« Last Edit: March 16, 2010, 02:06:34 pm by Eagleon »
Logged
Agora: open-source, next-gen online discussions with formal outcomes!
Music, Ballpoint
Support 100% Emigration, Everyone Walking Around Confused Forever 2044

praguepride

  • Bay Watcher
  • DF is serious business!
    • View Profile
Re: Need Some Programming Help
« Reply #6 on: March 16, 2010, 07:08:19 pm »

Wow, that is awesome!

Is there any way to make the alarm play continuously past the minute mark, and is it possible to make it full screen?'

Or at least 800x600 sized?
Logged
Man, dwarves are such a**holes!

Even automatic genocide would be a better approach

Eagleon

  • Bay Watcher
    • View Profile
    • Soundcloud
Re: Need Some Programming Help
« Reply #7 on: March 16, 2010, 10:18:57 pm »

Yes, and yes. I've updated both files.

Basically all I did was use a timer class that has a firing event - you can make the same in just about any other language, and I know Java at least has a similar class. When the timer calls the firing event, it subtracts from the total time (I used a generic timespan class which VB handily provided with built-in print support, but it would be easy to make another one) and reprints the label with the new time.
Logged
Agora: open-source, next-gen online discussions with formal outcomes!
Music, Ballpoint
Support 100% Emigration, Everyone Walking Around Confused Forever 2044

praguepride

  • Bay Watcher
  • DF is serious business!
    • View Profile
Re: Need Some Programming Help
« Reply #8 on: March 17, 2010, 11:28:02 am »

My issue is that I'm strictly web dev, I don't know how to create .exe files. I'm sure it's stupidly simple but I never learned it neverthe less.


Thanks for the awesome help! If you want to take credit, after the time reaches 0 you can display a "brought to you by NAME" if you want. I have no problem with you stamping your name on it. I know it's pretty small potatoes in the grand scheme of things, but this will result in an awesome prop for a game and so I thank you.
Logged
Man, dwarves are such a**holes!

Even automatic genocide would be a better approach

Andir

  • Bay Watcher
    • View Profile
Re: Need Some Programming Help
« Reply #9 on: March 18, 2010, 09:15:06 pm »

My issue is that I'm strictly web dev, I don't know how to create .exe files. I'm sure it's stupidly simple but I never learned it neverthe less.


Thanks for the awesome help! If you want to take credit, after the time reaches 0 you can display a "brought to you by NAME" if you want. I have no problem with you stamping your name on it. I know it's pretty small potatoes in the grand scheme of things, but this will result in an awesome prop for a game and so I thank you.

Even a web dev should be able to create a local HTML page using Javascript to do what you want...  :P

This crude little timer will work in IE (allow blocked content ... the .wav audio is blocked) I used warning.wav from my Steam/Resources folder and it works quite well for this.  Put it in the same folder as this html file.  Or you can also edit it.  It counts down from 10:00, at 1:00 it will play the sound, and change the background from black to white.  It's quite the alarm.
Spoiler (click to show/hide)
Logged
"Having faith" that the bridge will not fall, implies that the bridge itself isn't that trustworthy. It's not that different from "I pray that the bridge will hold my weight."