How to make a tappable point at an intersection of two lines?
ineedhelp
Member Posts: 12
We have two (laser) lines moving about, and we want to make it so that when the user taps the intersecting point of the lines, they gain a point. How would we go about do that in GS?
(The lines keep moving and shifting, thus the intersection continually shifts as well.)
Comments
Hi @ineedhelp and welcome to the Forums and GSC.
Interesting choice of Forum name.... I'd choose a more positive name personally! Maybe something to do with the type of games you're making?... (But up to you, of course...)
Also interesting problem; a question first though: is each of your lasers created with a single actor or is the line (laser) made from Replication or duplication of points?
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
each laser is an individual actor
OK. When I first read your question I began to think the answer involved vectorToAngle, etc., but after a quick test, I realised its relatively straightforward.
So there's possibly still a couple of other ways to do this, despite its simplicity; here's one way:
Make an integer attribute called LaserTouch, another integer for your points, let's call it, er...Points and a third, a boolean called Go.
Now in every one of your laser actors, put:
Make a blank actor, put it outside of the screen area. In it's Rules, put:
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
There are probably many ways to do this. In addition to @gyroscope's excellent advice, here is yet another way.
The basic idea is to have a touch sensitive 'intersection' actor. The laser actors are tracked to the 'intersection' actor.
If you make the 'intersection' actor invisible, it will give the illusion you are looking for.
Okay this is what I have right now.
Line 1:
Line 2:
The blank actor outside the screen:
And this is my screen, if it be of interest:
in which the big white box is an actor displaying ‘points’ and the small box is the intersection blank actor. right now the lines aren’t moving, but they are overlapping, but when i go into preview and click the intersection, nothing happens to the points.
if you must know the points actor looks like this:
Thanks for the reply though. I see your logic… it just doesn’t seem to work?
Hi @ineedhelp Your pics aren't showing up in your post- (as you can see as well, I'm sure) - png is the default for images into GSC but jpeg is the standard for posting pics in the Forums- so now you know for next time.
Here's the little test file I made, for you to see what's going on & compare with your version:
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
actually i can see the pics on my side. but i see what i did wrong now. thanks so much!
Ah, OK! Maybe...maybe... Prob. best to stick with jpegs tho' in future then you can be certain of every type of computer screen "seeing" it.
Good stuff and you're welcome; glad I could help.
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps