Author Topic: Flashlight Demo  (Read 4843 times)

0 Members and 1 Guest are viewing this topic.

Offline LincolnB

  • Check It Out Now
  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1115
  • Rating: +125/-4
  • By Hackers For Hackers
    • View Profile
Flashlight Demo
« on: February 14, 2012, 05:28:45 pm »
Hey, I spent the last coupla days messing around with the idea of raycasting, and came up with something that, while looks very different, is in reality moderately similar to a first person view type of game.



I'm not really planning anything big for this. If you want the executable, or the source, or an explanation (kind of a headache), just let me know and I'll hook you up.
Completed Projects:
   >> Spacky Emprise   >> Spacky 2 - Beta   >> Fantastic Sam
   >> An Exercise In Futility   >> GeoCore

My Current Projects:

Projects in Development:
In Medias Res - Contest Entry

Talk to me if you need help with Axe coding.


Spoiler For Bragging Rights:
Not much yet, hopefully this section will grow soon with time (and more contests)



Offline parserp

  • Hero Extraordinaire
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1455
  • Rating: +88/-7
  • The King Has Returned
    • View Profile
Re: Flashlight Demo
« Reply #1 on: February 14, 2012, 05:30:14 pm »
O.O wtf I was just wondering how do do something like that.


If you could provide the source, that would be awesome. :D

Offline saintrunner

  • Custom Spriter: You ask it! I'll Make it!
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1787
  • Rating: +115/-11
  • Flogging Molly
    • View Profile
    • Jonny K Music
Re: Flashlight Demo
« Reply #2 on: February 14, 2012, 05:31:32 pm »
Talk to BuilderBoy....Nightmare: Emergence .... ON CALC O.O
My Sprites Thread   :Updated often :) for your viewing pleasure

GAMES:

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Flashlight Demo
« Reply #3 on: February 14, 2012, 05:31:56 pm »
Looks pretty awesome :D Is it really raycasting?  Since i couldn't see any walls that were occluding the view of the beam

Offline nxtboy III

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 795
  • Rating: +26/-1
  • NXT!
    • View Profile
    • Program NXT
Re: Flashlight Demo
« Reply #4 on: February 14, 2012, 06:01:30 pm »
That looks real nice!
Could you explain in simple pseudocode?

Offline flyingfisch

  • I'm 1337 now!
  • Members
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1620
  • Rating: +94/-17
  • Testing, testing, 1...2...3...4...5...6...7...8..9
    • View Profile
    • Top Page Website Design
Re: Flashlight Demo
« Reply #5 on: February 14, 2012, 06:04:11 pm »
That looks pretty cool! And yeah, pseudo code so I can understand too :)



Quote from: my dad
"welcome to the world of computers, where everything seems to be based on random number generators"



The Game V. 2.0

Offline Darl181

  • «Yo buddy, you still alive?»
  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3408
  • Rating: +305/-13
  • VGhlIEdhbWU=
    • View Profile
    • darl181.webuda.com
Re: Flashlight Demo
« Reply #6 on: February 14, 2012, 06:42:51 pm »
This reminds me of an old Light project, except in the other one walls would cut off the beam.  This one runs a lot faster tho 0.o

Can't wait to see what's doable with it.
« Last Edit: February 14, 2012, 06:43:38 pm by Darl181 »
Vy'o'us pleorsdti thl'e gjaemue

Offline LincolnB

  • Check It Out Now
  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1115
  • Rating: +125/-4
  • By Hackers For Hackers
    • View Profile
Re: Flashlight Demo
« Reply #7 on: February 14, 2012, 10:57:35 pm »
Ok, so basically the flashlight drawing part loops through various degrees (180-210, 150-180, etc) and taking the sine and cosine, and drawing a bunch of individual lines based on that.

That probably didn't clear anything up. Source code!
compiled with Axe 1.1.1, and yes, you need the appvar for the source but not for the executable. Oh and KRAYSRC is the one to compile.
Completed Projects:
   >> Spacky Emprise   >> Spacky 2 - Beta   >> Fantastic Sam
   >> An Exercise In Futility   >> GeoCore

My Current Projects:

Projects in Development:
In Medias Res - Contest Entry

Talk to me if you need help with Axe coding.


Spoiler For Bragging Rights:
Not much yet, hopefully this section will grow soon with time (and more contests)



Offline Darl181

  • «Yo buddy, you still alive?»
  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3408
  • Rating: +305/-13
  • VGhlIEdhbWU=
    • View Profile
    • darl181.webuda.com
Re: Flashlight Demo
« Reply #8 on: February 14, 2012, 10:59:27 pm »
So it basically draws a bunch of lines next to each other, masking/unmasking where the "beam" is?
Vy'o'us pleorsdti thl'e gjaemue

Offline LincolnB

  • Check It Out Now
  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1115
  • Rating: +125/-4
  • By Hackers For Hackers
    • View Profile
Re: Flashlight Demo
« Reply #9 on: February 14, 2012, 11:08:10 pm »
Yeah, basically. But it only draws about ten-fifteen lines, and it draws a 7*7 sprite instead of a single pixel. Also, I do ClrDraw, then draw the beam, then DrawInv, and then I draw the map.
Completed Projects:
   >> Spacky Emprise   >> Spacky 2 - Beta   >> Fantastic Sam
   >> An Exercise In Futility   >> GeoCore

My Current Projects:

Projects in Development:
In Medias Res - Contest Entry

Talk to me if you need help with Axe coding.


Spoiler For Bragging Rights:
Not much yet, hopefully this section will grow soon with time (and more contests)



Offline nxtboy III

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 795
  • Rating: +26/-1
  • NXT!
    • View Profile
    • Program NXT
Re: Flashlight Demo
« Reply #10 on: February 18, 2012, 12:21:07 am »
But seriously, you could make a pretty cool game out of this, because you do not know what is behind you, like in 3D FPS's.

Offline chattahippie

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 358
  • Rating: +27/-0
  • Super Member! :D
    • View Profile
Re: Flashlight Demo
« Reply #11 on: February 18, 2012, 12:27:08 am »
But seriously, you could make a pretty cool game out of this, because you do not know what is behind you, like in 3D FPS's.

He is using the same principles that raycasters use, except he is not rendering the image from the player's perspective (as FP games do), which is why it seems so similar :)