Reply to this topic  Start new topic
> BombSquad
CSM
post Sep 21 2009, 01:05 AM
Post #1






Posts: 2,386
Joined: 1-September 06
From: ̶O̶h̶i̶o̶ Washington
Member No.: 16,587



BombSquad

IPB ImageIPB Image


version 0.1.0 release ε

Thanks go out to:
  • Hunter Ryba, Hunter890 - co-author: code, images
  • Anyone else in ##konfabulator that answered HRyba's or my questions or gave feedback otherwise
Features:
  • Inability to lose on the first click
  • Reset games by clicking on the window title, or right clicking and selecting "New Game"
  • Hold alt or command then click to set a flag
  • Hold shift and click to "sweep" an area*
  • Ability to create custom board games
  • Records the best times in 4 different game-play levels
  • Dynamo themes
  • Anything else I missed ...
* Sweeps only work on numbered squares. There must be enough flagged squares surrounding that square to match the number on the swept square. The non-flagged squares are then revealed for you. If a bomb is found, you lose, just as if you'd clicked it yourself.

Rules:
Click on empty squares to reveal them. Numbered squares indicate the presence of bombs. The number on the square shows how many. If all squares are revealed except for bombs, you've won. It may help to flag squares that may be bombs to make it easier to keep track of them (and not accidentally reveal them).

Themes:
We highly encourage making your own themes if you want. Theme's are very easy to create. They are just a zip file with properties file in it containing a set of keys with values indicating a color or an image location. If any properties are not given, they will be filled in with values from the default theme.

The exact file structure is a zip file with the theme name, and folder just inside that with the same name. Inside that folder should be a file named Theme.properties with all the keys and values. To see which ones are supported, just check out the default theme folders (they are unpacked to the Widget data directory). All paths in the Theme.properties entries are expanded in the Widget to point to the appropriate Widget data directory folder. Since the Widget can handle relative paths, theme authors may wish to sort the various related images into folders inside the theme zip.

Writeup:
The idea for this Widget is pretty old, and in fact was first seen in an almost unrelated post about popup preferences. Admittedly, the Widget did stall just because I couldn't figure out how to get Canvas to render the corners. I had written mostly all the GUI code and little back-end code. The GUI could have been redone if I'd had the back-end working. The code was also quite atrocious.

More recently, I said the same thing that spawned the original: making a minesweeper game is easy, it's just a recursive function to reveal the board ... Well, the current version isn't recursive any more (saves time and Y!WE's preciously small stack), but it was relatively easy. I started out to work from scratch, make the Widget with simple graphics, and go from there. HRyba wouldn't hear of that. So he designed all the graphics (I tweaked 2 images in the Matte theme) for the Widget and later contributed some code. After many versions, fixes, and features, here we are! It wasn't originally going to be theme-able, but it was suggested by HRyba, and due to the way I set up the Widget it proved to be very easy to do with no changes to a lot of existing code. The license was very late choice, so there's no license window (but I hate those anyway). If you don't agree with it, don't download or use the Widget (and if you already did, just delete the Widget).

Like Block Puzzler before this Widget, there are a few 1-file "library" classes, some of which are from Block Puzzler, and one is a revision of some code given away on the forums. The licenses of the Widget applies to those libraries except where noted by a license area at the top of the library file (the forum code is Public Domain, and ExtTimer is explicitly 3-clause BSD, like the Widget, for examples).

This Widget should be Y!WE 4.0 compatible, but in the absence of a 4.0-compatibility validator, we can only hope everything is 4.0 strict.

Extra-Credit:
Win an "Insane" game.
Also, check out the the source. I think there's more than a few "goodies" that can very well be applied to other Widgets.

Bugs Found in Y!WE:
Bugs found/encountered while developing this Widget.

New bugs:
  • Sending in paths to non-existent images to ScrollBar.setTrackInfo and setThumbInfo causes the Widget to crash
  • ScrollBar.autoHide now defaults to true, despite the documentation saying it defaults to false
  • A foreign HTML entity in a Widget version number crashes the engine, ex: & gama ; (use decimal instead: & #947 ; )
  • Setting the h/vOffset after the height/width sometimes changes the height of an element by 1
  • On the first load, Y!WE gives the first Window's h/vOffset as -1,-1 before widget.onLoad is called.
Old bugs:
  • Appending a non-DOM object to a DOM node crashes the Widget
  • Textareas will change height if initialized empty then later given text (even if size property is explicitly set)




A result of starting my server over, links from my posts may not work (especially those in the "temp" subdomain). If there is a link to something of which anyone would like to have a copy, personal message me with what you're looking for along with a way to provide this to you, and I'll see if I can find a copy. Thanks for your patience and understanding.


IPB Image - "Not just another open source project. Lend your talent and make a difference!" (Dead)

IPB Image - "The future is now." (No longer community site) (Domain has lapsed)

Published: AtomicComicBlast, Barra de Lenguas, ComicWizard-4.0, MicroColors, PassGen, ScrabbleChecker, SoundBank, Uni, VisualWidget, WarpedReality
Unavailable: Paradigm [clock], Puzzled, SecurityLogger, Wayback Widget
Ready to be published: Cαlcυlατοr, CursorTails, Blackout, Block Puzzler, BombSquad, Palette, SnipIt
ActiveDev:
InactiveDev/Dead: BeatMod, Bubble Pop, Canvas Clock, Canvas Gauges, Canvas Pro, Clipboard, Crayon, Hermes, InTune, Konverter, Magic Deck, OverRuled, Outside, Slither, SystemBeat, Tetresque, Tetrad, Widget, WinSysRemote
Dropped: BlankScreen, Document "Fixer", Intuitive [ -> Blackout], Motion Widget: HHGTTG
CoDevelopment: Atmosphere, Block Puzzler,
BombSquad
Miniature Scripts: BinarySearchTree, Calendar, Canvas Gears, Checkbox, File-Browser, LinkedList/Stack, MDI Setup, MiniMax AI, PieGraph, ProgressBar, Slider widget, TabbedPane, Table, Tokenizer, TreeMenu
Java+: Java Music Daemon, ScreenCapture JAR, Widget-Java/Server Bridge Example
"Published" Texts: DynamicWidgetGuide
Konfabulator Libraries: Color-space Library, Javable Widget Project
Widget Tutorials: "Spawning" Widgets, JavaScript Classes
Contests: Widget 4k - "Expanded" [not happening; canceled]
Non-Widget Work: Hazlenut, Konspirators Online, PHP BB-Code Parser, ShortClient, Zap
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
jcmatador
post Sep 21 2009, 05:45 PM
Post #2






Posts: 715
Joined: 27-July 05
Member No.: 7,413



Nice job guys. Well done - nice interfaces for the various items - good graphics. Two quick suggestions. You might want to put a play again icon after the end of each game on the screen and you might want some kind of basic instructions so that people know how to set a flag (and anything you want to share).

Again, great job! smile.gif





JC Cameron (my tech blog)
WidgetWorld: Your source for professional widget development and design
Brought to you by Revenution.com
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
IPB Image Sticky Deluxe IPB Image Neon Clock IPB Image Neon Gauges IPB Image FeedGlance
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
CSM
post Sep 21 2009, 07:35 PM
Post #3






Posts: 2,386
Joined: 1-September 06
From: ̶O̶h̶i̶o̶ Washington
Member No.: 16,587



Version 0.0.16 is up it adds an instructions dialog, which shows when the Widget is first loaded, and is also available from the context menu (above the "New Game" entry).
Version 0.0.17 is up, and it hooks the new instructions dialog into the theme-change events (oops!). Before it would only change themes if the Widget was restarted.
Version 0.0.18 is up. Fixes issues using the number-pad, restoring previous values on cancel, and maximum/minimum values for custom game setup. Default themes can no longer be removed.
Version 0.0.19 is up. It explicitly allows the backspace key (just in case) and fixes a bug that would wipe out the custom game field values if the custom window is opened, then canceled.
Version 0.0.20 is up. Removes a bit of unused code that could cause a Widget crash (via infinite recursion? cause unknown) with proper code (not present in BombSquad).

---
0.0.16 - I'll hold off on the "play again icon" for now. Hopefully the new instructions will be better at indicating how to start a new game. Also, I'm not exactly sure how this would fit in without detracting from the current interface layout. Ideas welcome.
0.0.18 - I'll hold off on doing anything with window titles or window zOrder for now. Waiting for confirmation on the delete/backspace issue.
0.0.20 - Discovered this while developing another Widget using the EventAdapter class with the DecoratedWindow class. The visible property setter fired of a visible event. Normally if that was a method, it would call that method. However, since this was a property, EventAdapter did its job and auto-created a function for future calls. Begin recursion? I dunno, but it lead to Widget crashes. Uncool. Note to users of EventAdapter, avoiding this is easy, just don't name your events the same as existing properties. Auto-function creation can also be turned off via constructor parameters to EventAdapter (which will allow both the property and the event to coexist peacefully).
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Cicerone Pavaloi
post Sep 22 2009, 03:22 PM
Post #4






Posts: 562
Joined: 7-March 07
From: Iasi, Romania
Member No.: 20,296



QUOTE(CSM @ Sep 21 2009, 10:35 PM) *
Version 0.0.17

Looking good! cool.gif

Couple of things, though...
  • The instructions dialog pops up at hOffset: -45 vOffset: 1 (first time only, when it appears automatically).
  • Custom Game dialog is not working properly:
    • I can't use delete or backspace keys (if I select the text first, it works).
    • Also it doesn't let me to enter any number from the numeric keypad keys (if I select the text first, I can enter only 1 char).
    • The limits for 30 Columns, 24 Rows and 667 Bombs isn't reflected in the dialog (I mean, I can enter 99 x 99 with 999 bombs, then the board will be 30 x 24 with 667 bombs, but when I call the dialog again it still shows me 99 99 999...). Same goes for the lower limits of 10 x 10 with 10.
    • If I enter some values and close the dialog from the X corner button, when I call the dialog again it still shows the last entered values.
  • I think it should ask if I really want a new game when I click the window title (I can accidentally click trying to move the window...)
  • Similar, maybe it should ask when deleting a theme - I didn't find a way to reset to the default set (by the way, the third button is suppose to do what? - cause nothing happens when clicked...).
  • I think dialog windows should stay on top of the game window.
  • All the dialog window titles have a mouse event attached that does nothing but blocks the default move behavior (I'm used to move windows by the caption...).


Tested on Mac OS X (10.4.11) with Y!WE 4.5.2 (10A50)




User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Cicerone Pavaloi
post Sep 22 2009, 05:03 PM
Post #5






Posts: 562
Joined: 7-March 07
From: Iasi, Romania
Member No.: 20,296



QUOTE(Cicerone Pavaloi @ Sep 22 2009, 06:22 PM) *
Couple of things, though...

Similar behavior in Windows XP Professional 2002 SP3 with Y!WE 4.5.2 (10A50), only the delete and backspace keys are working in the Custom Game dialog without first selecting the text. wink.gif




User is offlineProfile CardPM
Go to the top of the page
+Quote Post
CSM
post Sep 22 2009, 07:11 PM
Post #6






Posts: 2,386
Joined: 1-September 06
From: ̶O̶h̶i̶o̶ Washington
Member No.: 16,587



Nitpick! tongue.gif

QUOTE(Cicerone Pavaloi @ Sep 22 2009, 10:22 AM) *

Looking good! cool.gif

Couple of things, though...
  • The instructions dialog pops up at hOffset: -45 vOffset: 1 (first time only, when it appears automatically).
  • Custom Game dialog is not working properly:
    • I can't use delete or backspace keys (if I select the text first, it works).
    • Also it doesn't let me to enter any number from the numeric keypad keys (if I select the text first, I can enter only 1 char).
    • The limits for 30 Columns, 24 Rows and 667 Bombs isn't reflected in the dialog (I mean, I can enter 99 x 99 with 999 bombs, then the board will be 30 x 24 with 667 bombs, but when I call the dialog again it still shows me 99 99 999...). Same goes for the lower limits of 10 x 10 with 10.
    • If I enter some values and close the dialog from the X corner button, when I call the dialog again it still shows the last entered values.
  • I think it should ask if I really want a new game when I click the window title (I can accidentally click trying to move the window...)
  • Similar, maybe it should ask when deleting a theme - I didn't find a way to reset to the default set (by the way, the third button is suppose to do what? - cause nothing happens when clicked...).
  • I think dialog windows should stay on top of the game window.
  • All the dialog window titles have a mouse event attached that does nothing but blocks the default move behavior (I'm used to move windows by the caption...).
Tested on Mac OS X (10.4.11) with Y!WE 4.5.2 (10A50)
Windows XP Professional 2002 SP3 with Y!WE 4.5.2 (10A50)
  1. I didn't see it until I deleted the registry entry. Dialog now shows up when onLoad is called.* This appears to be a Y!WE bug. See op list.
    * I can't bring myself to rely on it just appearing in the right place by just setting it visible without setting the location.
    1. I don't see that here. Backspace and delete work regardless of the selected status of the text. Can you confirm it still exists in the latest version?
    2. Fixed.
    3. Fixed. This dialog should really reflect the current board's state when it is shown, but I made that difficult to do without creating a new dialog each time.
    4. Fixed.
  2. This was designed to be automatic, as if you'd clicked the large ugly smiley button in "winmine."
  3. Fixed. Originally, the idea was that since you couldn't delete the theme currently being used, you'd be left with at least one default theme. They don't exactly reset, if you delete their on-disk folders/zips they get reextracted but not readded. It is now set up to prevent deletion of any default theme (as they are harder to readd ... who wants to browse to the Widget data directory?).
    • That reloads the currently selected theme. The idea with this was that it would make theme creation slightly easier by allowing an author to select their theme, edit the values, refresh the theme, and so on (without restarting the Widget).
    • All those buttons have tooltips describing what they are for. It's very hard to trigger them on Windows XP.
  4. That is ... hard. They are all independent floating windows. Unfortunately, there's no way to enforce some sort of window order in Y!WE. I tried focusing the window which lost its focus, but that doesn't do anything to correct the window zOrder.
  5. All windows/dialogs inherit from a base class which implements an "onClick" on the title text. Only the game window and an easter-egg use this event.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Cicerone Pavaloi
post Sep 23 2009, 06:42 AM
Post #7






Posts: 562
Joined: 7-March 07
From: Iasi, Romania
Member No.: 20,296



QUOTE(CSM @ Sep 22 2009, 10:11 PM) *
Fixed.
All fixes work on Windows. smile.gif
On Mac, the delete key is still not working, backspace is ok though (Mac users are used with backspace as the "main delete" key, so this may be a small problem now).
Also on Mac only, numpad keys still can't be used. (You may need a Mac user/developer with more time on its hands wink.gif)

QUOTE
Unfortunately, there's no way to enforce some sort of window order in Y!WE.
I had a solution in my head to simulate modal windows, but I remembered that I never test it, so I'll try to do that first, then bother you again with this.

QUOTE
Nitpick!
The dock icon do not reflect the currently active theme. tongue.gif

P.S. Sometime next week (I hope) I will try to make a theme or two...





User is offlineProfile CardPM
Go to the top of the page
+Quote Post
CSM
post Sep 23 2009, 06:55 AM
Post #8






Posts: 2,386
Joined: 1-September 06
From: ̶O̶h̶i̶o̶ Washington
Member No.: 16,587



QUOTE(Cicerone Pavaloi @ Sep 23 2009, 01:42 AM) *
On Mac, the delete key is still not working, backspace is ok though (Mac users are used with backspace as the "main delete" key, so this may be a small problem now).
Also on Mac only, numpad keys still can't be used. (You may need a Mac user/developer with more time on its hands wink.gif)
I couldn't get the event listener to fire for the delete key on Windows. I'm going to guess that on Mac it does fire (which would make events very inconsistent between platforms). If I knew the keyCode of the "delete key", I can add another special case to return before processing anything (thus avoiding rejecting it). As to the number pad, I just used the keyCodes that were spit out at me for the numbers. I am going to guess that Mac gives me different keyCodes than Windows does. <sarcasm>Which is totally awesome.</sarcasm>

QUOTE(Cicerone Pavaloi @ Sep 23 2009, 01:42 AM) *
I had a solution in my head to simulate modal windows, but I remembered that I never test it, so I'll try to do that first, then bother you again with this.
Well, before we even get around to fixing this, it should be simplified. Currently I think you can open all three windows at once. That's not really a bad thing in and of itself, but if we were to try to order them ... It's probably infinitely easier to not open any other windows if one other than the base window is open, allowing us to only worry about zOrder of two windows (base and window-on-top).

QUOTE(Cicerone Pavaloi @ Sep 23 2009, 01:42 AM) *
The dock icon do not reflect the currently active theme. tongue.gif
I deserved that.

QUOTE(Cicerone Pavaloi @ Sep 23 2009, 01:42 AM) *
P.S. Sometime next week (I hope) I will try to make a theme or two...
Great!
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
CSM
post Sep 30 2009, 07:54 AM
Post #9






Posts: 2,386
Joined: 1-September 06
From: ̶O̶h̶i̶o̶ Washington
Member No.: 16,587



Barring any further changes or problems that anyone may have, I propose to re-brand version 0.0.20 as 0.1.0 release ε and turn off the debug menu.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Fast Reply  Reply to this topic    Start new topic  
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members: