Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > Community Boards > Just for Kicks Challenges

Reply
 
Thread Tools Rate Thread Display Modes
Old 09-06-2003, 08:40 AM   #1
vulcanpimp
Registered User
 
Join Date: Aug 2003
Posts: 116
Default sunrise

I saw someone mention sunrize a short time ago and decided to have a crack at it. My ry involves the use of the radial gradient fill. Its actually very slow even on fast computers but it shows some of the effects that can be created. I made the radial fill very small to make it look like a sun. I put a simple cosine on the sun to create a glowing effect. Notice the x and y have to be recalculated when the size of the sun is changed.

the colors are a bit crumby but ...

http://www.geocities.com/hairybobby2000/fxsunrise.html

the codes on my site to make it easier to copy - just ctrl+a and ctrl+c.
vulcanpimp is offline   Reply With Quote
Old 09-10-2003, 11:41 AM   #2
vulcanpimp
Registered User
 
Join Date: Aug 2003
Posts: 116
Default

hello, I'm kinda feeling all alone in here.

so I know its not that good but I thought the idea was quite cute! at least a "that looks interesting would be nice".

or even a better luck next time.

I'm all alone......
vulcanpimp is offline   Reply With Quote
Old 09-12-2003, 09:29 AM   #3
vulcanpimp
Registered User
 
Join Date: Aug 2003
Posts: 116
Default

hello is anybody there


oh baaaaaaaaby baby...

how was I supposed to know..

how can you live without me ...da da dee


HIT me baby one more time

Hiiiiit me baby one more time


G I guess if I can't interest anyone with my code I could interest you with some of my singing.
vulcanpimp is offline   Reply With Quote
Old 09-14-2003, 04:46 PM   #4
Grifter
hopeful
 
Join Date: Apr 2002
Posts: 248
Default

um yeah, nearly 190 views and no replies is a bit harsh.

it is actually quite a good idea (i think), and i'll try and get round to having a shot at it if i can come up with some ideas. i'll try and put it up by wednesday (but i make no promises ).

i think the reason no one has replied is because it's the weekend, and challenges usually get more attention midweek.

cheers
Grifter
Grifter is offline   Reply With Quote
Old 09-14-2003, 06:19 PM   #5
McGiver
Goldmember
 
McGiver's Avatar
 
Join Date: Feb 2003
Location: bavaria in germany
Posts: 1,627
Default

hmm, I think I'll do something too, but at the moment I am (and was) kind of busy because of the new mx04
McGiver is offline   Reply With Quote
Old 09-15-2003, 07:08 AM   #6
vulcanpimp
Registered User
 
Join Date: Aug 2003
Posts: 116
Default

haven't really turned my attention to mx4 yet - still haven't got my head round version 6 yet. first impressions are though that its not all that an improvement AS wise.
vulcanpimp is offline   Reply With Quote
Old 09-15-2003, 10:52 AM   #7
McGiver
Goldmember
 
McGiver's Avatar
 
Join Date: Feb 2003
Location: bavaria in germany
Posts: 1,627
Default

I've also only the trial, but as I see it classes are a new aspect of flash. I wasn't very happy trying classes the first time, because i didn't really know what to do with them. I still think there are few thing you can do with classes, you couldn't do with as1, but they can make things easier! (I think I'll write a utorial when I'm more into that)
hope I'll find some time to do a surise too (not uninteresting at all, maybe a sunriseclass )
McGiver is offline   Reply With Quote
Old 09-18-2003, 03:42 PM   #8
Grifter
hopeful
 
Join Date: Apr 2002
Posts: 248
Default

well, i said i would do something, and here it is:

ActionScript Code:
/* coded by: Grifter, recommended:30fps (or 60fps) with a black background */ //create a green box to represent the landscape //highest depth of the 3 elements because it is on top _root.createEmptyMovieClip("landscape", 3); with(_root.landscape){     moveTo(0, 300);     lineStyle(1, 0x009900, 100);     lineTo(400, 300);     beginFill(0x009900,100);     lineTo(400,400);     lineTo(0,400);     lineTo(0,300);     endFill(); } //create a blue box to represent the sky //lowest depth so that the sun appears over it _root.createEmptyMovieClip("sky", 1); with(_root.sky){     moveTo(0, 300);     lineStyle(1, 0xff6600, 50);     lineTo(400, 300);     beginFill(0x4060ff,100);     lineTo(400,0);     lineTo(0,0);     lineTo(0,0);     endFill(); } //create a yellow circle for the sun _root.createEmptyMovieClip("sun", 2); with(_root.sun){     //rather dubious method i came up with for drawing a circle - could be better, but i thought it'd do     moveTo(30*Math.sin(0), 30*Math.cos(0));     lineStyle(3, 0xffff33, 100);     for(i=0; i<48; i++){         lineTo(30*Math.sin(i), 30*Math.cos(i));     } } //function used to give the sun it's circular motion //the same function could be used to move a moon about behind the sun (add 180 to the moon's theta) //r is the radius of the circle circularPath = function(mc, r, theta, cx, cy){     mc._x = cx - (r*Math.sin((theta*(Math.PI/180))));     mc._y = cy - (r*Math.cos((theta*(Math.PI/180)))); } //define what happens every frame //the sun moves every frame, and the skies alpha is adjusted to represent day & night _root.onEnterFrame = function(){     sun.j++;     circularPath(sun, 150, -sun.j+90, 200, 300);     sky._alpha = (Math.sin(sun.j*(Math.PI/180))+0.5)*100; }

wasn't sure if there was a line limit, it's around 40 without the comments (and i'm sure there's ways of reducing it as well).
if someone wants to add a moon to it, you're welcome (it shouldn't be too difficult because you can apply the circularPath function to that as well).
enjoy!
Grifter

Last edited by Grifter; 09-18-2003 at 03:44 PM..
Grifter is offline   Reply With Quote
Old 09-18-2003, 04:01 PM   #9
dzy2566
Deprecated User?
 
dzy2566's Avatar
 
Join Date: Jul 2003
Location: Sherman Oaks, Ca
Posts: 1,086
Send a message via AIM to dzy2566
Default

Very toon-town. I like it.
dzy2566 is offline   Reply With Quote
Old 09-18-2003, 06:17 PM   #10
McGiver
Goldmember
 
McGiver's Avatar
 
Join Date: Feb 2003
Location: bavaria in germany
Posts: 1,627
Default

Nothing too impressive, I just saw Grifter's (which looks cool, by the way) and remembered that I wanted to do one over the weekend too (sorry I didn't) and recognized, I got time at the moment. prehaps I will do something better (or at least add some shadow throwing trees to this one later)

ActionScript Code:
_root.onEnterFrame = function() {     i += 5;     _root.skyx = Math.cos(i/200)*700+300;     _root.skyy = Math.sin(i/100)*200+200;     _root.flooralpha = 100-Math.sin(i/100+Math.PI*3/2)*50;     mycolor = Math.sin(i/100+Math.PI*3/2)*154+102;     _root.colorbright = parseInt("0x00"+mycolor.toString(16)+"00");     _root.colorheight = Math.sin(i/50+Math.PI*3/2)*500;     _root.colorx = Math.cos(i/200)*700+300;     myplanet = _root.createEmptyMovieClip("myplanet", 123);     myplanet.beginGradientFill("radial", [_root.colorbright, 0x006600], [_root.flooralpha, _root.flooralpha], [0, 250], {matrixType:"box", x:(_root.colorx-(200-_root.colorheight/5)/2), y:(200-_root.colorheight/1.6), w:(200-_root.colorheight/5), h:_root.colorheight, r:(45/180)*Math.PI});     myplanet.moveTo(0, 250);     myplanet.lineTo(550, 250);     myplanet.lineTo(650, 400);     myplanet.lineTo(-100, 400);     myplanet.lineTo(0, 250);     myplanet.endFill();     mysky = _root.createEmptyMovieClip("mysky", 124);     mysky.beginGradientFill("radial", [0xffff00, 0xB5E3FF, 0x00ccFF, 0x0099FF, 0x003366], [100, 100, 100, 100, 100], [10, 30, 90, 160, 250], {matrixType:"box", x:(_root.skyx-350), y:(_root.skyy-350), w:700, h:700, r:(45/180)*Math.PI});     mysky.lineTo(550, 0);     mysky.lineTo(550, 250);     mysky.lineTo(0, 250);     mysky.lineTo(0, 0);     mysky.endFill(); };
(the 2 sunrises are intended!)

Last edited by McGiver; 05-02-2004 at 02:04 PM..
McGiver is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:05 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.