Reply to topic  [ 4 posts ] 
How can I get this working? 
Author Message
I haven't seen my friends in so long
User avatar

Joined: Thu Apr 23, 2009 7:35 pm
Posts: 6580
Location: Getting there
Reply with quote
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.

_________________
Oliver Foggin - iPhone Dev

JJW009 wrote:
The count will go up until they stop counting. That's the way counting works.


Doodle Sub!
Game Of Life

Image Image


Sun Nov 03, 2013 3:16 pm
Profile WWW
What's a life?
User avatar

Joined: Thu Apr 23, 2009 8:25 pm
Posts: 10691
Location: Bramsche
Reply with quote
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
Profile ICQ
I haven't seen my friends in so long
User avatar

Joined: Thu Jun 18, 2009 5:10 pm
Posts: 5836
Reply with quote
Can you not just click in column A, then click column B and draw the line between the two objects?

_________________
Jim

Image


Sun Nov 03, 2013 6:59 pm
Profile
Spends far too much time on here
User avatar

Joined: Thu Apr 23, 2009 9:40 pm
Posts: 4876
Location: Newcastle
Reply with quote
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)

_________________
Twitter
Charlie 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
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 21 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

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.