I-smel's Banner

I-smel

Gear Flash News Main
I-smel

Age/Gender: 18, Male
Location: England, MAN-CHESTer

NO MEANS YES AND YES MEANS ANAL.

Newgrounds Stats

Sign-Up Date:
3/2/06

Level: 1
Aura: Neutral

Rank: Civilian
Blams: 0
Saves: 7
Rank #: 161,467

Whistle Status: Normal

Exp. Points: 10 / 20
Exp. Rank #: 1,454,624
Voting Pow.: 1.50 votes

BBS Posts: 1,260 (0.92 per day)
Flash Reviews: 0
Music Reviews: 0
Trophies: 5
Stickers: 0

Entry #53

Jump to Entry: [ 12446 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 ]


I-smel

ray casting

Posted by I-smel Oct. 27, 2009 @ 8:14 PM EDT

I saw this thing ages ago n I was like waaaaaaht and I just did it.

Ok so like- years n years ago I was watching the first couple trailers for Gish; that game about the tar guy who like goes hard n stuff. At first I thought it was a Flash game, but it had all this 2D light and shadow stuff where I was like WHAT THE FUCK YOU CANT DO THAT. HOW- WHAT- FUCKIN- HOW DO I DO THAT? but then I decided it's not a Flash game and you can't do that in Flash. And if you could then I couldn't really get my head around it at the time.
But I thought about it, and you probably can. I just faffed about for a few minutes and I KIND OF DID?
Yeah I'm gonna say I did.

SHOCK

OOOOOOOOOOOMG oh shit now I should make a game about this.
Except its stupidly over-intensive, so it can never be used in an actual game. and it's kind of messy.

Anyway I just started LEVEL 7 of Legend of JOHNNY which is the LAST LEVEL. I don't work at Smashmouth Games anymore (reffer the last couple pages) so now I've got time to actually make games. JOHNNY's comin up oh my fuck.

That's it.
I bought World of Goo for $5.

strongtanium.JPG

Log in to comment! | Share this!

The People Have Spoken

15 Comments

Oct. 27, 2009 | 8:28 PM sontuk says:

sdak;fjas;dklfj


Oct. 27, 2009 | 8:35 PM sontuk says:

dynamic light


Oct. 27, 2009 | 8:45 PM angryglacier says:

World of goo is a amazing game the soundtrack will leave you stunned.


Oct. 27, 2009 | 8:57 PM dnatoxic says:

LAWL its impenetrable!


Oct. 27, 2009 | 8:59 PM zrb says:

blur it out and messiness is gone :3
lookin good :P


Oct. 27, 2009 | 9:05 PM FatKidWitAJetPak says:

That looks like preety complicated coding, but if you wanted to apply shadow effects why not simply put it inside of the animation? Hand draw the shadows and all that stuff. That raytracing would be for light though wouldnt it. Interesting there. You coder you.

Well anyway Im up for voice acting this baby. So just let me know if you want me to scream into a mic or something again. :)


Oct. 27, 2009 | 9:09 PM FrozenFire says:

I get a mic soon Ill try out


Oct. 27, 2009 | 9:28 PM I-smel says:

nobody actually try that yet. You'll all know when I want voice actors cos Ill be like- sayin it.


Oct. 27, 2009 | 11:15 PM biIIgates says:

very niice!


Oct. 28, 2009 | 12:25 AM SkyFire2008 says:

Duuuuuuuuuuude!
How did you manage to do this? Is it AS 2 or 3? If its 3, could you tell me, how to make the same in AS2?

Oct. 28, 2009 | 12:10 PM I-smel responds:

It's AS2. I don't know AS3.
Ok so I made the ground out of pink squares, made it a movieclip with the instance name "ground".
Then drew the white circle as a light, made it a movieclip with the instance name "CENTRE".
and made the background black.
on CENTRE, I wrote this:

onClipEvent (enterFrame) {
_x = _root._xmouse;
_y = _root._ymouse;
}

to make it follow the mouse.
on the actual frame 1 of the file, I wrote this- not straight away though, it took a load of trial n error:

SPACING = 5;
// SPACING is the distance between each i node
onEnterFrame = function () {
_root.createEmptyMovieClip("LIGHT ", 0);
_root["LIGHT"].moveTo(_root.CENTR E._x, _root.CENTRE._y);
_root["LIGHT"].beginFill(0xFFFFFF , 50);
//These first few lines create a new movieclip that'll be the light.
for (z=0; z<=360; z += 3) {
// check for ground in 360 degrees around the CENTRE- one every 3 degrees
for (i=0; i<30; i++) {
// every 3 degrees, do 30 checks that stretch out from the CENTRE
Xnode = _root.CENTRE._x+(i*SPACING)*Math.
cos(z*(Math.PI/180));
Ynode = _root.CENTRE._y+(i*SPACING)*Math.
sin(z*(Math.PI/180));
if (!_root.ground.hitTest(Xnode, Ynode, true)) {
//create a node wherever empty space hits the ground
_root["HITPOINTX"+z] = Xnode;
_root["HITPOINTY"+z] = Ynode;
} else {
break;
//if the light's touching the ground, then stop
}
}
_root["LIGHT"].lineTo(_root["HITP OINTX"+z], _root["HITPOINTY"+z]);
// do a dot-to-dot around all the nodes, creating the light shape.
}
_root["LIGHT"].endFill();
};

and thats it. I wouldnt reccomend it if youre new to actionscript.
Also remember- it probably cant be used in an actual game cos itd ruin the framerate.

Updated: Oct. 28, 2009, 12:12 PM

Oct. 28, 2009 | 12:31 AM Nayhan says:

I heard somewhere that you could do this. It looks really cool although it is a bit messy.
If it's ok can you send me an .fla (for learning purposes, will rewrite script not just use yours), or at least give me some hints as to how you did it.

Oct. 28, 2009 | 12:12 PM I-smel responds:

reffer to above


Oct. 28, 2009 | 5:56 AM TomaMoto says:

Sweet! Is that manipulating the graphics class in AS3? Slick job on the non-smooth edges where the light collides with the level. :D

Oct. 28, 2009 | 12:12 PM I-smel responds:

its the graphics API in AS2. and thanks!


Oct. 28, 2009 | 7:56 PM The-EXP says:

Man that method is using a shotgun to kill a fly, but even so I like your thinking around a problem.
Also learn some AS3, you could do cycles like that without affecting the framerate in the slightest :D

Oct. 29, 2009 | 12:07 PM I-smel responds:

thatd take so much time Id have to stop making games

and "using a shotgun to kill a fly" is a great phrase


Oct. 30, 2009 | 1:41 AM SkyFire2008 says:

So, I worked a little and...KINDA DID IT TOO.

Check this shit out!
http://www.swfcabin.com/open/12568789 37

It's not finished yet, though.

Oct. 30, 2009 | 1:25 PM I-smel responds:

oh yea, drawing the shadow also almost works.


Nov. 1, 2009 | 4:33 PM The-Bobster says:

Do you have any idea when Legend of JOHNNY is comin out?

Nov. 1, 2009 | 6:14 PM I-smel responds:

this year? hopefully?
Im doin the final boss now, then Ive got cutscenes to do. In past games I've neglected cutscenes, just doin slideshows instead, but this time I'm goin all the way.

Jump to Entry: [ 12446 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 ]