CSC510-2015-Axitron / maze

Main repo for maze game
0 stars 2 forks source link

Maze maze designer work for large mazes #65

Closed duh102 closed 9 years ago

duh102 commented 9 years ago

It breaks when the entire maze can't fit onscreen, and it has trouble with wide mazes where maze cells are smaller than normal size.

macluo commented 9 years ago

I was actually about to warn you that could happen. Can HTML5 canvas work in frame with scrollbar? I tried and it didn't work.

duh102 commented 9 years ago

I'm going to redo the entire thing to be easier. The canvas can be removed and a table-wide onclick can be applied to each td, which can then report where it is based on where in the parent (the row) it is (to get the column number) and where the parent is in it's parent (the table) (to get the row number). Then the entire table can be scrolled however you like and it will work fine, no weird resize problems. All in theory, of course, might end up not panning out.

macluo commented 9 years ago

The canvas is actually what make the mouse buttondown drawing work. I tried implementing on each td and the result wasn't pretty.

macluo commented 9 years ago

I forgot. If the table can detect the mouse event and reports the cursor position then I think you can get rid of canvas.

duh102 commented 9 years ago

Anything can have an on() event put onto it, and you can track dragging too.

macluo commented 9 years ago

Then I think that solves the problem.

duh102 commented 9 years ago

http://jsfiddle.net/EZLxv/2/, for a demo (not mine)

duh102 commented 9 years ago

Well, now it works for large mazes but you can't click single cells for some reason. I didn't have time to fix that, so I'm going to submit that as another bug and call this closed.