Be a Supporter!

Earthquake function...

  • 250 Views
  • 8 Replies
New Topic Respond to this Topic
CrazyRock
CrazyRock
  • Member since: May. 13, 2010
  • Offline.
Forum Stats
Member
Level 12
Movie Buff
Earthquake function... 2010-12-02 09:42:22 Reply

Hey i just did a earthquake like thingy...Please tell me if it is any good?

1.Make a MovieClip,give it instant name shakey
2.Open the actions panel and copy this code to it

onClipEvent
(enterFrame){ function shake() { }
shakex=random(20)-10
shakey=random(20)-10
shakex*=0.7
shakey*=0.7
if(shakex<1 && shakey<1){
_parent._x=0
_parent._y=0
}

setInterval(shake,100)
_parent._x-=shakex
_parent._y-=shakey
}

Then test your movie...


Thanks Chdonga for the signature. <3

BBS Signature
CyberXR
CyberXR
  • Member since: Aug. 22, 2008
  • Offline.
Forum Stats
Member
Level 09
Blank Slate
Response to Earthquake function... 2010-12-02 10:19:12 Reply

Wooh, I have searched for such a function. Will test it tonight


Check out the coolest Donkey Kong Game on NG!
http://www.newgrounds.com/portal/vi ew/459064
100 posts @ Posted at: 9/15/08 07:36 AM http://www.newgrounds.com/bbs/topic /969232

CrazyRock
CrazyRock
  • Member since: May. 13, 2010
  • Offline.
Forum Stats
Member
Level 12
Movie Buff
Response to Earthquake function... 2010-12-02 10:46:42 Reply

I'm glad... :)

Ofcource you can make as many items as you want on the screen and put this code only on that one movieclip...it will shake and move all scene...


Thanks Chdonga for the signature. <3

BBS Signature
newave
newave
  • Member since: Aug. 9, 2010
  • Offline.
Forum Stats
Member
Level 01
Blank Slate
Response to Earthquake function... 2010-12-02 12:51:41 Reply

Very nice!!!!!!!!!!!

Wolfos
Wolfos
  • Member since: Jan. 19, 2008
  • Offline.
Forum Stats
Member
Level 25
Game Developer
Response to Earthquake function... 2010-12-02 12:58:27 Reply

I was wondering why that was so cool, until I saw that it actually moved the stage.
Not hard to make but I didn't know you could actually do that.

milchreis
milchreis
  • Member since: Jan. 11, 2008
  • Offline.
Forum Stats
Member
Level 26
Programmer
Response to Earthquake function... 2010-12-02 13:02:36 Reply

It's not good.
People wrote javascript window shakers like 10 years ago.

Also the code is bad.

Niallmcfc
Niallmcfc
  • Member since: Aug. 16, 2009
  • Offline.
Forum Stats
Member
Level 09
Gamer
Response to Earthquake function... 2010-12-02 13:35:39 Reply

At 12/2/10 01:02 PM, milchreis wrote: It's not good.
People wrote javascript window shakers like 10 years ago.

Also the code is bad.

You enjoy pissing on bonfires, don't you?


Signature? What signature?

Also, any games I plan to make may or may not become vaporware. I'm not good with organizing my life...

YoinK
YoinK
  • Member since: Jan. 5, 2001
  • Offline.
Forum Stats
Member
Level 60
Game Developer
Response to Earthquake function... 2010-12-02 13:38:21 Reply

well i thought that was neat!


Kanye West Did What??????
They should make a black guy the manager, they know how to run shit!
2 Girls 1 Cup .... THE SONG!!!!

CrazyRock
CrazyRock
  • Member since: May. 13, 2010
  • Offline.
Forum Stats
Member
Level 12
Movie Buff
Response to Earthquake function... 2010-12-02 17:46:12 Reply

Thank you guys :)

You can use it whenever you want :)


Thanks Chdonga for the signature. <3

BBS Signature