Pyro's Awesome Lasers (for Kall)

You must understand the Game Editor concepts, before post here.

Pyro's Awesome Lasers (for Kall)

Postby pyrometal » Sun Jun 07, 2009 12:50 am

Hello everyone!

Sorry I've been off the forum for so long, I had no internet connection for the last 2 weeks... But nevermind that!

You should check out this demo! I built this for Kalladdolf whom asked me for help to make this. This code is an example of how to create lasers which are limited in lenght by walls and can be triped by object passing by. This uses a single canvas to draw all lasers and the screen's position does not matter; The lasers will always be drawn properly as long as they are set-up correctly.

Unfortunately, since this uses a canvas actor and since the code has to do a lot of collision checking, using this in an excessive manner or simply making the canvas too big may cause some lagging in your game. Therefore you must use this with caution!

laser_demo.zip
Ima firin' ma LAZAAR!
(6.92 KiB) Downloaded 165 times


--pyro
SPRITE WARRIOR:
Free, open-source & crossplatform pixel art editor (currently under construction).
User avatar
pyrometal
 
Posts: 706
Joined: Wed Nov 28, 2007 4:07 am
Location: Kingston, ON, Canada
Score: 86 Give a positive score

Re: Pyro's Awesome Lasers (for Kall)

Postby jimmynewguy » Sun Jun 07, 2009 4:55 am

That's a nice way of using the canvas there I personally have no use for it, but it's pretty spiffy!
Last edited by jimmynewguy on Sun Jun 07, 2009 2:26 pm, edited 1 time in total.
Working on a probably too ambitious project! Wild-west-adventure-RPG-shooter-thing.
User avatar
jimmynewguy
 
Posts: 1137
Joined: Sat Mar 31, 2007 6:27 pm
Score: 89 Give a positive score

Re: Pyro's Awesome Lasers (for Kall)

Postby Kalladdolf » Sun Jun 07, 2009 9:02 am

Thank you pyro, you are, like, (one of) the awesomest person(s) in this community!
I think I'll post a smiley on this special occasion: :D
User avatar
Kalladdolf
 
Posts: 2427
Joined: Sat Sep 08, 2007 8:22 am
Location: Germany
Score: 120 Give a positive score

Re: Pyro's Awesome Lasers (for Kall)

Postby pyrometal » Sun Jun 07, 2009 10:46 am

lol, thanks! Glad I could help you out.
SPRITE WARRIOR:
Free, open-source & crossplatform pixel art editor (currently under construction).
User avatar
pyrometal
 
Posts: 706
Joined: Wed Nov 28, 2007 4:07 am
Location: Kingston, ON, Canada
Score: 86 Give a positive score

Re: Pyro's Awesome Lasers (for Kall)

Postby Hblade » Sun Jun 07, 2009 7:16 pm

Cool, nice job.
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Pyro's Awesome Lasers (for Kall)

Postby zygoth » Tue Jun 09, 2009 2:21 pm

Let me see if I understand this...the code checks all points in the line of the laser until it comes into a collision at which point it stops and then the canvas draws a line there. right? Pretty neat, but I imagine it eats up a lot of cpu. cool stuff!

Zygo
Nova: 100% Vertigo/Mazeman: 100%
Visit my website to download them both! http://www.ketonegames.com
User avatar
zygoth
 
Posts: 140
Joined: Mon Jun 11, 2007 6:37 pm
Score: 5 Give a positive score

Re: Pyro's Awesome Lasers (for Kall)

Postby Bee-Ant » Tue Jun 09, 2009 2:51 pm

is this only for kall?
User avatar
Bee-Ant
 
Posts: 3723
Joined: Wed Apr 11, 2007 12:05 pm
Location: http://www.instagram.com/bee_ant
Score: 210 Give a positive score

Re: Pyro's Awesome Lasers (for Kall)

Postby Kalladdolf » Tue Jun 09, 2009 5:05 pm

No, it's for everyone, I'm just the one who made the request.
User avatar
Kalladdolf
 
Posts: 2427
Joined: Sat Sep 08, 2007 8:22 am
Location: Germany
Score: 120 Give a positive score

Re: Pyro's Awesome Lasers (for Kall)

Postby pyrometal » Tue Jun 09, 2009 8:55 pm

@Bee-ant - Anyone can use this! If I had wanted only Kall to use it I would have sent it to him in an email.

@Zygoth - You got it right, that's exactly what's happening here, but I'd have to say that the canvas eats the cpu more than the collision checking.
SPRITE WARRIOR:
Free, open-source & crossplatform pixel art editor (currently under construction).
User avatar
pyrometal
 
Posts: 706
Joined: Wed Nov 28, 2007 4:07 am
Location: Kingston, ON, Canada
Score: 86 Give a positive score


Return to Advanced Topics

Who is online

Users browsing this forum: No registered users and 1 guest

cron