x404.co.uk http://www.x404.co.uk/forum/ |
|
How can I get this working? http://www.x404.co.uk/forum/viewtopic.php?f=4&t=20515 |
Page 1 of 1 |
Author: | Fogmeister [ Sun Nov 03, 2013 3:16 pm ] |
Post subject: | How can I get this working? |
OK, I'm really stuck. I need to quote a guy for an app and I'm just making sure that it's something I can actually do. The app is a fairly simple idea but it's more of a game type app which is why I'm not so sure. The app is a question and answer app. There will be up to 10 question answer pairs. The questions appear along the top of the screen. The answers appear along the bottom of the screen. The user then has to "connect" pairs of questions and answers. The user will press down at the question and drag a line out to the answer (just a straight line). I can do a line from one point to another. The problem I'm having is then I have to analyse the lines drawn to see if they are correct. I'm trying to find a way to wrap it all into a data model. I come from a very MVC design background so not sure if I should use the same for the game or allow the V and the M to mix a bit? i.e. store data in the circles ad line etc... Any help much appreciated. |
Author: | big_D [ Sun Nov 03, 2013 6:35 pm ] |
Post subject: | Re: How can I get this working? |
Can't you do it as a simple drag and drop? That would be simpler than drawing a line and working out whether it was intercepting the right element. If you set the questions and answers as objects, does iOS support drag and drop recognition to say when Object A is placed on Object B? You could either draw the line in afterwards or you could run it on interrupt and plot the current finger position and run the line to that point, until the user removes their finger from the screen, at which point your drag-and-drop will also be complete and you should get an event for that. |
Author: | rustybucket [ Sun Nov 03, 2013 6:59 pm ] |
Post subject: | Re: How can I get this working? |
Can you not just click in column A, then click column B and draw the line between the two objects? |
Author: | finlay666 [ Sun Nov 03, 2013 11:20 pm ] |
Post subject: | Re: How can I get this working? |
Just store the vector locations of the boxes, the 2d line will have the start lie within the question and the end within an answer (if not it's not valid) validating point lies in a box: endpoint (vector) > x1 & endpoint (vector) > y1 & endpoint < x2 & endpoint < y2 rinse, repeat (there may already be this sort of thing, C# has intersect for rectangles for instance) View model, linked list of questions & answers, kvp array linking pointers for questions and answers? Pretty simple model (containing the objects) It's not really suited to MVC as there will likely be binding from the view and controller, so MVVM seems more suited (I think iOS is more MVVM in it's MVC implementation though as MVC should be stateless) |
Page 1 of 1 | All times are UTC |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |