mtable = {{x=0 , y=10 },{}…}
store path coordinates into table then loop through that table and draw dot in that location
dot.x = mtable[i].x
dot.y = mtable[i].y
hope this helps you [import]uid: 74537 topic_id: 15108 reply_id: 58854[/import]
thx for info m.hantash, but I was hoping for something that calculates x and y coordinates.
I’m working on a solution using thales theorem. I’ll be back to submit after some test (if it works! !)… [import]uid: 9328 topic_id: 15108 reply_id: 58856[/import]
re [import]uid: 9328 topic_id: 15108 reply_id: 58857[/import]
@Antheor hope you did it using thales theorm if you did it and test it you can share it i don’t know about how to implement thales using ansca sdk so good luck [import]uid: 74537 topic_id: 15108 reply_id: 58911[/import]
local function listenForEnd (event)
if event.phase == "ended" then
print ("Finger Up Now move yo ass")
move();
end
end
Runtime:addEventListener("touch", listenForEnd)
lol “Finger up now move yo ass” hahaha.
In all seriousness, I’ve looked at the martian control. That code is SERIOUSLY CRAZY. It’s hard to pick out exactly what you need for “just” what you want to do.
[import]uid: 61600 topic_id: 15108 reply_id: 58946[/import]
The principle is easy, the application is borderline rocket science.
To capture the line, you need to start recording the initial start point when the event.phase “began” happens on a touch event (luckily we have event.startX and event.startY set for us)
Then for each touch event while the event.phase is “moved”, record the x, y of that point (in an array/table). At this point you will draw a line from the previous x, y to the current x, y, make the current x, y the previous x, y, and store the lines display object in an array so you can remove them later.
When the event.phase becomes “ended” then start moving your object through the various x, y’s in your saved array, removing the lines as you go.
Now the fun parts:
o applying curve fitting instead of drawing straight lines (gives you a smooth curve). There is a spline function already in the code library for this.
o Calculating the angle of the line and rotating your object accordingly. This is some simple right angle trig and setting rotation on your object is easy.
o Calculating the distance between two points and adjusting your objects transition between them accordingly. This is a bit more tricky because of the way transition.to works (as in not very well in a for/while loop over your table)
[import]uid: 19626 topic_id: 15108 reply_id: 58951[/import]
" The principle is easy, the application is borderline rocket science."
That describes most of my games. Dead simple concept, then all sudden you have to learn A* or djikstra algorthm to implement it lol.
[import]uid: 61600 topic_id: 15108 reply_id: 58957[/import]
hantash, I have pbs to do an exact dotted line.
I guess I will take your “table” idea, and use robmiracle code with print to get all coods (that will be long to do …) [import]uid: 9328 topic_id: 15108 reply_id: 58964[/import]
the best choice [import]uid: 74537 topic_id: 15108 reply_id: 59032[/import]
Hi guys. I’ve been watching the Code of Martian Control and I want to try this: The ships land in the planets without drawing a path, I mean, each planet be the goal of certain ships but the ships move to the destination not only linearly, so you have to touch them to destroy before they land. But I dont know how to do that. Could you guide me about it please?
Thanks [import]uid: 81363 topic_id: 15108 reply_id: 64094[/import]
Particle Candy can do that for you (ships reaching a point with a semi random path + destruction on touch). [import]uid: 9328 topic_id: 15108 reply_id: 64098[/import]