grumpygamer Posted April 20, 2015 Share Posted April 20, 2015 Hey guys,I'm trying to figure out a way to create a beam weapon that originates from the ship.The beam should lock on to an enemy at a time and be curvy.This is not possible by sprite, so here I am asking how would I go about it? Here are some examples: Problems:- While I can probably draw a line between to objects I'd have to make it curvy.- The line causes the enemy to have an impact hovering sprite over the front.- The line would not be pixelated. Link to comment Share on other sites More sharing options...
ZoomBox Posted April 20, 2015 Share Posted April 20, 2015 You should this out: http://gamemechanicexplorer.com/#lightning-1Also check the links on the left margin Basic lightningWith branchesWith glowWith shake and flashYou are ZeusThis is an awesome site for some mechanics in phaser. Link to comment Share on other sites More sharing options...
grumpygamer Posted April 20, 2015 Author Share Posted April 20, 2015 That's a start, but I will have to find a way of making the lightning pixelated.Also I will need to find a way of making curved pixelated lines too.- A Link to comment Share on other sites More sharing options...
grumpygamer Posted April 22, 2015 Author Share Posted April 22, 2015 Bumping this as I am having a look at a bezier curve on canvas.Is this the right way to go?http://www.html5canvastutorials.com/tutorials/html5-canvas-bezier-curves/ If so how do I then make it pixellated? Link to comment Share on other sites More sharing options...
drhayes Posted April 23, 2015 Share Posted April 23, 2015 I have no idea how to do what you're looking for. ( = That said, have you checked out Phaser.Rope? "A Rope is a Sprite that has a repeating texture. The texture can be scrolled and scaled and will automatically wrap on the edges as it does so." Then you can position the rope pieces however you want and the texture will do the right thing? Maybe? Link to comment Share on other sites More sharing options...
MichaelD Posted April 23, 2015 Share Posted April 23, 2015 Use texture that is pixelated (pixel graphics is the way to go), as for the bezier curve I think it is the correct way to do that, but I would certainly check out Phaser.Rope as drhayes suggested. Link to comment Share on other sites More sharing options...
grumpygamer Posted April 24, 2015 Author Share Posted April 24, 2015 Thanks. Seems that's the right route.http://test.xapient.net/phaser/ALL/snake.html but I imagine I would have to disable physics for it.Is it possible? I am asking out of laziness as I wanted to reply but had no look around yet! Link to comment Share on other sites More sharing options...
drhayes Posted April 24, 2015 Share Posted April 24, 2015 It won't have physics on it by default. Link to comment Share on other sites More sharing options...
Oscar Abraham Posted April 24, 2015 Share Posted April 24, 2015 You can also pixelate anything with a proper webgl filter. Or you can draw to a smaller canvas texture, disable smoothing and make it larger. Link to comment Share on other sites More sharing options...
Recommended Posts