SSH Productions: Module documentation for SimpleSnow.zip

Module: SimpleSnow 1.10, by SSH

Ho ho ho! Some simple snow!

Download SimpleSnow as a zip file

Author

Andrew MacCormack (SSH)

Please use the PM function on the AGS forums to contact

me about problems with this module

Abstract

Snow, without using a plugin

Dependencies

AGS 3.1 or Later

Functions

 function SimpleSnow.Init(int view);

Prepares some snowfield sprites to use, using the sprites in view as snow.

 function SimpleSnow.Go();

Starts snowing

 function SimpleSnow.No();

Stops snowing

 function SimpleSnow.SetWind(int wind);

Sets wind speed and direction.

Configuration

Fiddle about with the #defines here to change snow, but its not an

exact science

Example

  int wind;
  function room_a() {
    // Room script: after room fadein
    SimpleSnow.Init(SNOWFLAKES);
    wind=0;
    SimpleSnow.Go();
    SetTimer(1, 40);
  }
  function room_b() {
    // Room script: repeatedly execute
    if (IsTimerExpired(1)) {
      if (Random(1)) { if (wind<8) wind++; else wind=1; }
      else { if (wind>-8) wind--; else wind=-1; }
	   SimpleSnow.SetWind(wind);
      SetTimer(1, 40);
    }
  }

Caveats

No transparency

Snow movement sucks

Lots of overlays is slow

Revision history

16 Dec 05 v1.00 Initial version

15 Dec 08 v1.10 AGS 3.1 version, using DrawingSurface and resolution-independent

Licence

SimpleSnow AGS script module

Copyright (C) 2005, 2008 Andrew MacCormack

Permission is hereby granted, free of charge, to any person obtaining a copy

of this software and associated documentation files (the "Software"), to

deal in the Software without restriction, including without limitation the

rights to use, copy, modify, merge, publish, distribute, sublicense, and/or

sell copies of the Software, and to permit persons to whom the Software is

furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in

all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR

IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,

FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL

THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER

LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER

DEALINGS IN THE SOFTWARE.

In addition to the licences mentioned in the modules themselves, you may choose to use the following creative commons licence if you prefer for all AGS modules and open source code resources on my site.

Creative Commons License
This work is licenced under a Creative Commons Licence.