Deprecated: Assigning the return value of new by reference is deprecated in /var/www/siebn.de/wiki/inc/parserutils.php on line 205

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/siebn.de/wiki/inc/parserutils.php on line 208

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/siebn.de/wiki/inc/parserutils.php on line 389

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/siebn.de/wiki/inc/parserutils.php on line 530

Deprecated: Function split() is deprecated in /var/www/siebn.de/wiki/inc/auth.php on line 154
bs2_codinghelp_bs2_explosions [Burning Sand Wiki]
Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CET/1.0/no DST' instead in /var/www/siebn.de/wiki/inc/template.php on line 242
 

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/siebn.de/wiki/inc/parser/parser.php on line 66

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/siebn.de/wiki/inc/parser/lexer.php on line 292

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/siebn.de/wiki/inc/parser/handler.php on line 22

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/siebn.de/wiki/inc/parser/handler.php on line 49

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/siebn.de/wiki/inc/parser/handler.php on line 213

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/siebn.de/wiki/inc/parser/handler.php on line 241

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/siebn.de/wiki/inc/parser/handler.php on line 295

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/siebn.de/wiki/inc/parser/handler.php on line 328

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/siebn.de/wiki/inc/parser/handler.php on line 575

Deprecated: Function split() is deprecated in /var/www/siebn.de/wiki/inc/parser/metadata.php on line 289

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/siebn.de/wiki/inc/parser/xhtml.php on line 939

Help Main Menu x

TNT Type Explosion

Original TNTexplosion:

TRIGGER TNTexplosion {
	DRAW 0 FILLEDCIRCLE X1 Y1 (0 RAND 20) 0
	FOR explosion1raycount FROM 1 TO 2 DO TNTexplosionRay (X1 * 100) (Y1 * 100) ((0 - 100) RAND 100) ((0 - 100) RAND 100) (25 RAND 50)
}

TRIGGER TNTexplosionRay {
	DRAW elementfire FILLEDCIRCLE ($0 / 100) ($1 / 100) 2 0
	IF ($4 > 0) <TIMER 1 FRAMES TNTexplosionRay ($0 - $3) ($1 - $2) ($2 - 1) $3 ($4 - 1)>
}

lets just take the first trigger, and put some static value:

TRIGGER TNTexplosion {
	DRAW 0 FILLEDCIRCLE X1 Y1 (0 RAND 20) 0
	FOR explosion1raycount FROM 1 TO 2 DO TNTexplosionRay (X1 * 100) (Y1 * 100) 100 300 50
}

Now lets explain theses : (X1 * 100) (Y1 * 100) 100 300 50

  • (X1 * 100) : This is the X position to start the explosion. (X)
  • (Y1 * 100) : This is the Y position to start the explosion. (Y)
  • 100 : This is the Y movement offset on the screen. Negative is Down and Positive is Up. (Y_MOVE)
  • 300 : This is the X movement offset on the screen. Negative is Left and Positive is Right. (X_MOVE)
  • 50 : This is the life of the explosion. (LIFE)
    • Note that all value (except life) are multiplied by 100, this is to get more precise movement on the screen.

So to make the explosion going in all direction, not only one, you must use RAND, thats what Sieben use in his explosion, like the first below.

The FOR … FROM 1 TO 2 DO … part is the number of projectile you want in the explosion.

Best way to get what you want, is trial & errors. Change some value and see whats the difference until you get what you want.

 

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CET/1.0/no DST' instead in /var/www/siebn.de/wiki/inc/template.php on line 785
bs2_codinghelp_bs2_explosions.txt · Last modified: 2012/01/09 18:50 by 80.128.115.94
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki