View unanswered posts | View active topics
It is currently Fri May 30, 2025 9:51 am
|
Page 1 of 1
|
[ 4 posts ] |
|
How can I get this working?
Author |
Message |
Fogmeister
I haven't seen my friends in so long
Joined: Thu Apr 23, 2009 7:35 pm Posts: 6580 Location: Getting there
|
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.
|
Sun Nov 03, 2013 3:16 pm |
|
 |
big_D
What's a life?
Joined: Thu Apr 23, 2009 8:25 pm Posts: 10691 Location: Bramsche
|
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.
_________________ "Do you know what this is? Hmm? No, I can see you do not. You have that vacant look in your eyes, which says hold my head to your ear, you will hear the sea!" - Londo Molari
Executive Producer No Agenda Show 246
|
Sun Nov 03, 2013 6:35 pm |
|
 |
rustybucket
I haven't seen my friends in so long
Joined: Thu Jun 18, 2009 5:10 pm Posts: 5836
|
Can you not just click in column A, then click column B and draw the line between the two objects?
_________________Jim
|
Sun Nov 03, 2013 6:59 pm |
|
 |
finlay666
Spends far too much time on here
Joined: Thu Apr 23, 2009 9:40 pm Posts: 4876 Location: Newcastle
|
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)
_________________TwitterCharlie Brooker: Macs are glorified Fisher-Price activity centres for adults; computers for scaredy cats too nervous to learn how proper computers work; computers for people who earnestly believe in feng shui.
|
Sun Nov 03, 2013 11:20 pm |
|
|
|
Page 1 of 1
|
[ 4 posts ] |
|
Who is online |
Users browsing this forum: No registered users and 7 guests |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum
|
|