parwaniprakash Posted November 8, 2014 Share Posted November 8, 2014 Hello everyone, I am creating a game where multiple lines are created according to time. I need to delete the line on one click on that line. I am using this code for line creation:- graphic.moveTo(50, 50);graphic.lineTo(200, 250); using this code line got created.. now I need to delete this line on clicking any part of the line. Thanks for your response in adavance.. Thanks Link to comment Share on other sites More sharing options...
casarock Posted November 8, 2014 Share Posted November 8, 2014 As a game is painting the whole screen at each frame, you should simply stop drawing this line. You don't have to care about removing something. The update-method of Phaser clears the canvas and draws everything you want at the next frame. This is a common technique for games. Hiere you'll find more information about a common game loop: http://gameprogrammingpatterns.com/game-loop.html And more infos about common patterns are here: http://gameprogrammingpatterns.com just read it online or get it as ebook or printed book. Link to comment Share on other sites More sharing options...
parwaniprakash Posted March 5, 2015 Author Share Posted March 5, 2015 Hello I need to drag the line from its any point and merge it to new node to make a new route. For eg. there is a path of train we have created and now I want to change the path by dragging the current path to new node. is there any possiblity to do that.. waiting for your response. Thanks Link to comment Share on other sites More sharing options...
Recommended Posts