CSC510-2015-Axitron / maze

Main repo for maze game
0 stars 2 forks source link

Load specific maze by maze number #62

Closed duh102 closed 9 years ago

duh102 commented 9 years ago

Be able to select a specific maze through writing the maze number into the UI in some fashion.

macluo commented 9 years ago

Are players allowed to load only those mazes that they have finished?

duh102 commented 9 years ago

No, they should be able to hop around wherever, I'd think.

macluo commented 9 years ago

If someone could make jQuery UI work for #59, #61, and #62, I can take care of the rest of logics.

macluo commented 9 years ago
/mazes/user/:user : none; returns the mazes submitted by that user, error if db error or user not valid, values if successful

Does it return an array of mazeno and its names? Couldn't find the details in server.js and apiClient.js

duh102 commented 9 years ago

It's similar to mazes/category/:category in that it returns the userid, then an array mazes[] that has the id and display name for the maze:

{
 "userid":(id)
 mazes:[
  {"mazeno":(mazeno), "displayName":(maze name)}
 ]
}
macluo commented 9 years ago

Ok. Thanks!

macluo commented 9 years ago

Now the required methods are ready 082fed78dd8fcad242ed2579ada08790f9186bf2. Because we already have CSS defined, would dropdown work better for #59, #61, and #62?

meneal commented 9 years ago

I'm going to give this a shot using a JQuery UI menu. Would menu structure be like this?

Category1 -mazename1 -mazename2 Category2 -mazename1 -mazename2 etc

I guess the downside of going this direction with it would be that if a large number of mazes were eventually added the menu could get kind of out of control. But it might be a nice way to keep everything together. Thoughts on doing it this way? Here's a demo of it.

duh102 commented 9 years ago

It might start auto-scrolling if you get more items into the menu, not sure. We should cross that bridge when we come to it, though. Since we're a bit pressed on time, functionality is more important in the short term.

meneal commented 9 years ago

Is it ok if I hard code the categories? I'm assuming we aren't changing those right?

duh102 commented 9 years ago

You should be able to get them via /categories, but if it's too much work you can hard code them for now.

macluo commented 9 years ago

Alternatively, you could get those info from remoteDB.categories and remoteDB.mazeCategory two variables.

meneal commented 9 years ago

Yeah it's really not the problem of getting the categories, it's actually placing them correctly using append. There's a weird structure with this menu I'm using, and I think I shouldn't have too much of a problem placing all of the maze names by category it's just placing the actual categories that might be a bit annoying. I'll push here in awhile and show you guys what I'm doing for now.

On Fri, Mar 27, 2015 at 12:02 PM, Mark Luo notifications@github.com wrote:

Alternatively, you could get those info from remoteDB.catgories and remoteDB.mazeCategory two variables.

— Reply to this email directly or view it on GitHub https://github.com/CSC510-2015-Axitron/maze/issues/62#issuecomment-86989282 .

meneal commented 9 years ago

Got some of this done. I have it in sideMenu.js. I decided to split it out and work on it on a completely separate html and js file. It's in index2.html on the sidemenu branch if you want to take a look. I noticed though that there aren't any mazes in any categories other than small, and I know you've been working on mazes Will. Have you already put mazes in other categories?

Next phase of this is to put it in mazeMenu and get loading working correctly. I can also put the procedural button in here too if need be. The idea is for now that when you hit the level button this menu will pop out and then you just click to load.

I'll probably be able to get rid of the hardcoded categories too, but for now it's just easier for me to figure it out this way.

meneal commented 9 years ago

Put menu into mazeMenu.js and index.html. Working ok now, but need to fix a few issues with the categories splitting correctly. I was also hoping to just latch onto the regular loading methods that are part of the mazeMenu currently, but it's really not working that well yet. I'll try again in the morning, but if it's a no go then I'll talk to you guys about it at the meeting tomorrow.

meneal commented 9 years ago

This is pretty much done. The only thing I'm having any trouble with now is actually setting the level number. I haven't been able to do that or make it so the game carries on from the loaded level. It just goes back to where it left off in the sequence of the levels.

meneal commented 9 years ago

So this is finally done too. The only thing about it is that it currently runs an http get on a maze that doesn't exist and then just gets a 404 back in the console. I initially tried to deal with it by using the number of mazes in the database, but that doesn't work, because the number of mazes in the database is currently something like 23 and the actual numbers start at 19.

So I'm not sure whether we want to change that and have the maze numbers actually start at zero and fail a bit more gracefully or not. It works as is though, it just spits out some ugly stuff in the console. It also currently doesn't tell you what you did wrong it just closes the menu if you entered a nonsensical value to load.

duh102 commented 9 years ago

Theoretically we could change remoteDB to actually pick up on error numbers, currently if there's any error (not a 200 status response) it kicks it to the error path and logs a bunch of stuff to the console. You can actually extract the status number out of the error function, though, and handle it. Unsure if we want to do that or not, just based on how seldom we encounter it.

macluo commented 9 years ago

I will look into that all together tomorrow.

meneal commented 9 years ago

Take a look at how I ended up dealing with it and let me know if you think that it could be handled a bit more gracefully. I'm not sure given what you're saying that it really can be handled better.

On Sat, Mar 28, 2015 at 11:04 PM, Will Morrow notifications@github.com wrote:

Theoretically we could change remoteDB to actually pick up on error numbers, currently if there's any error (not a 200 status response) it kicks it to the error path and logs a bunch of stuff to the console. You can actually extract the status number out of the error function, though, and handle it. Unsure if we want to do that or not, just based on how seldom we encounter it.

— Reply to this email directly or view it on GitHub https://github.com/CSC510-2015-Axitron/maze/issues/62#issuecomment-87343975 .