Please login or register.

Login with username, password and session length
Advanced search  

News:

IRC channel - server: waelisch.de  channel: #wme (read more)

Author Topic: ShakeScreen  (Read 5586 times)

0 Members and 1 Guest are viewing this topic.

MMR

  • Global Moderator
  • Frequent poster
  • *
  • Karma: 3
  • Offline Offline
  • Gender: Male
  • Posts: 349
  • http://mmrdeveloper.wordpress.com/
    • View Profile
    • TinyWME
ShakeScreen
« on: October 11, 2003, 12:15:43 PM »

Is there any way to Shake the Screen like if you were feeling an earthquake???

I think a function like this will be useful (at least for me)

Think on an elevator, when the elevator reaches the top (its destiny), shakes the screen ;)
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re:ShakeScreen
« Reply #1 on: October 11, 2003, 12:54:04 PM »

Well, the Leo demo has a shaking screen, http://www.dead-code.org/forum/index.php?board=2;action=display;threadid=70

I don't know how obleo did it, I think he was moving each scene entity (it can by done by a simple "for" loop). But even simpler solution would be probably using the Scene.SkipTo() method repeatedly.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

MMR

  • Global Moderator
  • Frequent poster
  • *
  • Karma: 3
  • Offline Offline
  • Gender: Male
  • Posts: 349
  • http://mmrdeveloper.wordpress.com/
    • View Profile
    • TinyWME
Re:ShakeScreen
« Reply #2 on: October 12, 2003, 10:51:21 PM »

I'm still thinking it would be useful to have a function that could do all this stuff ;)
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Shake it baby!
« Reply #3 on: October 13, 2003, 05:08:18 PM »

I'm kinda hesitant about adding rarely used functions, which can be (relatively easily) done in scripting.


Code: [Select]
////////////////////////////////////////////////////////////////////////////////
method Shake()
{
   for(var i=0; i<10; i=i+1)
   {
    ShiftSceneNodes(-10, 0);
    Sleep(100);
    ShiftSceneNodes(10, 0);      
    Sleep(100);
  }
}

////////////////////////////////////////////////////////////////////////////////
function ShiftSceneNodes(var ShiftX, var ShiftY)
{
   for(var i=0; i<Scene.NumLayers; i=i+1)
   {
      var Layer = Scene.GetLayer(i);
      
      for(var j=0; j<Layer.NumNodes; j=j+1)
      {
         var Node = Layer.GetNode(j);
         Node.X = Node.X + ShiftX;
         Node.Y = Node.Y + ShiftY;
      }      
   }
   actor.X = actor.X + ShiftX;
   actor.Y = actor.Y + ShiftY;
}
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

MMR

  • Global Moderator
  • Frequent poster
  • *
  • Karma: 3
  • Offline Offline
  • Gender: Male
  • Posts: 349
  • http://mmrdeveloper.wordpress.com/
    • View Profile
    • TinyWME
Re:ShakeScreen
« Reply #4 on: October 13, 2003, 05:30:10 PM »

Thanks Mnemonic!!

It works fine ;)
Logged
 

Page created in 0.064 seconds with 20 queries.