Advertisement
d_brezoev

ChaoticParticle

Feb 25th, 2014
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.73 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ParticleSystem
  4. {
  5.     public class ChaoticParticle : Particle
  6.     {
  7.         protected Random rand = new Random();
  8.  
  9.         public ChaoticParticle(MatrixCoords position, MatrixCoords speed)
  10.             : base(position, speed)
  11.         {
  12.         }        
  13.         protected override void Move()
  14.         {                        
  15.             int row = this.rand.Next(-1,1+1);
  16.             int col = this.rand.Next(-1, 1+1);              
  17.             this.Position += new MatrixCoords(row, col);                                                                                      
  18.         }
  19.         public override char[,] GetImage()
  20.         {
  21.             return new char[,] { { 'R' } };
  22.         }
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement