Arimaa Forum (http://arimaa.com/arimaa/forum/cgi/YaBB.cgi)
Arimaa >> General Discussion >> Javascript game planner
(Message started by: rbarreira on Apr 15th, 2011, 10:50am)

Title: Javascript game planner
Post by rbarreira on Apr 15th, 2011, 10:50am
I've made a page which allows one to use the Javascript plan window with an arbitrary starting position or list of moves. I noticed some were asking for something similar (as opposed to the current game planner (http://arimaa.com/arimaa/games/planGame.cgi) which uses the old flash client), so here it is:

http://109.74.204.218/arimaa/plan_js/plan_js.html

This allows one to easily copy back variations tried on the plan window, by using the M button in the JS client.

Let me know if there's any problems with it!

Title: Re: Javascript game planner
Post by Hippo on Apr 16th, 2011, 2:31am
After clicking the view button, new tab opens but not all images are loaded and the viewer says "done".
Tested on both mozilla and chrome.

Title: Re: Javascript game planner
Post by rbarreira on Apr 16th, 2011, 3:28am
Strange...

I have only tried it with Firefox in Linux, I'll give it a try on other browsers/OS's later.

Web programming is not my big thing, but just as ideas did you activate any special security settings or have some antivirus that might be interfering? This page points at arimaa.com for the JS client, so there might be some cross-site scripting prevention kicking in.

Title: Re: Javascript game planner
Post by Hippo on Apr 16th, 2011, 7:23am
I have tested it on Xperia's Opera with exactly same result. ... all gold  pieces on captured area, silver pieces replaced by dummy image on the same place, board image not loaded.

Title: Re: Javascript game planner
Post by Hippo on Apr 16th, 2011, 7:28am

on 04/16/11 at 07:23:35, Hippo wrote:
I have tested it on Xperia's Opera with exactly same result. ... all gold  pieces on captured area, silver pieces replaced by dummy image on the same place, board image not loaded.

Oh silly me, after writing anything to the move list the view button invoked page which loaded entirely.

Title: Re: Javascript game planner
Post by rbarreira on Apr 16th, 2011, 9:00am
Great that you got it to work. Yeah, the easiest way to try it is just to copy the example on the right (or use one of jdb's endgame puzzles).

I tried it on Firefox, Chrome and IE in Windows, it seems to work fine.

Title: Re: Javascript game planner
Post by Fritzlein on Apr 17th, 2011, 5:22pm
I just got a chance to try this out via jdb's Puzzle 10.  It's fantastic!  The expert mode of the Javascript planner is far superior to the old planner which requires send and undo, etc.  Omar definitely needs to pull this on site as the official planner.  Thanks, Ricardo!

Title: Re: Javascript game planner
Post by omar on Apr 20th, 2011, 1:48pm
Glad to see that you were easily able to setup the JS client for this.

I've changed the plan game page to use the JS client also.

http://arimaa.com/arimaa/games/planGame.cgi

The old version using the Flash client is still available from:

http://arimaa.com/arimaa/games/planGame1.cgi

Title: Re: Javascript game planner
Post by mistre on Apr 21st, 2011, 9:12am
The Javascript game planner does not work if you are using the Flash Client when planning moves in postal games.

Can you change it back to default to the Flash game planner when using the Flash Client?

Thanks.

Title: Re: Javascript game planner
Post by omar on Apr 29th, 2011, 12:00pm

on 04/21/11 at 09:12:53, mistre wrote:
The Javascript game planner does not work if you are using the Flash Client when planning moves in postal games.

Can you change it back to default to the Flash game planner when using the Flash Client?

Thanks.


Does, the JavaScript client not work for you? I am going to drop support for the Flash client pretty soon.

Title: Re: Javascript game planner
Post by mistre on Apr 29th, 2011, 4:17pm

on 04/29/11 at 12:00:36, omar wrote:
Does, the JavaScript client not work for you? I am going to drop support for the Flash client pretty soon.


Oh please don't!  I don't like the Javascript client at all.   I have this problem with the Javascript Client where blue boxes show up when you click on a cell. I prefer the original Flash v1 by far.


Title: Re: Javascript game planner
Post by Fritzlein on Apr 29th, 2011, 6:11pm

on 04/29/11 at 16:17:55, mistre wrote:
I have this problem with the Javascript Client where blue boxes show up when you click on a cell.

Yes, I also have the problem of selecting board squares.  Then I have to click off the board to get the selection to go away.  It is annoying.  However, I still prefer to use the Javascript client for its other nice features.

Title: Re: Javascript game planner
Post by Swynndla on Apr 29th, 2011, 8:22pm
The blue square artifact can be replicated by moving the mouse when the mouse is clicked (if the left mouse button is clicked, and the movement of the mouse causes a drag).  I think that is why it happens, and if you don't move your mouse I don't think it will happen.

Whether it's the mouse that's too sensitive or the javascript too unforgiving (or is it an OS thing?), I don't know, but if I make sure I'm not moving the mouse before I click, then it seems good.  Playing blitz is a problem for me though, as I'm trying to move quickly, and I sometimes get a blue square, have to click the side of the board, try and move quickly again ... and this may happen several times while doing four steps quickly on one move, which backfires as I use more time on blue squares than I would have if I'd done it carefully, but still it means that in a blitz game, sometimes it feels like I'm concentrating on moving my mouse carefully and slowly rather than concentrating on the game.  I can get used to it though.

Title: Re: Javascript game planner
Post by rbarreira on Apr 30th, 2011, 4:04am
Yes, I have also seen the selected-squares problem with the JS client... Maybe there's a way to disable selection from the JS code.

Omar, a google search for "javascript disable selection" gets results like this one (http://www.bandit.co.nz/writings/?tut=Javascript_Disable_Select), that might work. But note that it uses two hacks for different browsers, and the code seems to interfere with the mouse so you'd probably need to make sure it doesn't break the clicking as well.

Title: Re: Javascript game planner
Post by omar on May 10th, 2011, 4:53pm
I had looked for a solution also, but it was not working right. As JavaScript matures I'm sure there will be standard  solution for this. For now, as Karl mentioned, just click off the board to have the selection highlighting go away.

One of the reasons I switched to using a JavaScript client was so that others could also download it and play around with the code and contribute improvements.




Arimaa Forum » Powered by YaBB 1 Gold - SP 1.3.1!
YaBB © 2000-2003. All Rights Reserved.