Changeset 2268


Ignore:
Timestamp:
2011-06-29 12:10:50 (8 years ago)
Author:
teeevasa
Message:

Talletus.

Location:
2011/26/JaakkoL/Rogue Agent 2372/Rogue Agent 2372
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • 2011/26/JaakkoL/Rogue Agent 2372/Rogue Agent 2372/Rogue Agent 2372/GenWeapon.cs

    r2261 r2268  
    55using Jypeli.Effects; 
    66using Jypeli.Widgets; 
     7using Weapons; 
    78 
    89public class GenWeapon 
     10{ 
     11    Weapon weapon; 
     12 
     13    GenWeapon(string weaponName) 
     14    { 
     15     
     16    } 
     17 
     18    private void loadWeapon(string weaponName) 
     19    {  
     20         
     21    } 
     22 
     23    private void changeWeapon(string weaponName) 
     24    {  
     25     
     26    } 
     27} 
     28 
     29struct Weapon 
    930{  
     31    int reloadTime; 
     32    int firingInterval; 
     33    string name; 
     34    Image weaponImage; 
     35    Image bulletImage; 
     36    SoundEffect sound; 
    1037 
     38    Weapon(int _reloadTime, int _firingInterval, string weaponName, 
     39        string weaponImgPath, string bulletImgPath, string soundEffectPath) 
     40    { 
     41        reloadTime = _reloadTime; 
     42        firingInterval = _firingInterval; 
     43        name = weaponName; 
     44        weaponImage = Game.LoadImage(weaponImgPath); 
     45        bulletImage = Game.LoadImage(bulletImgPath); 
     46        sound = Game.LoadSoundEffect(soundEffectPath); 
     47    } 
    1148} 
  • 2011/26/JaakkoL/Rogue Agent 2372/Rogue Agent 2372/Rogue Agent 2372/Weapons.cs

    r2261 r2268  
    66using Jypeli.Widgets; 
    77 
    8 class Pistol : GenWeapon 
     8/* Each Weapon has its own loader, which *must* load the following: 
     9 *     int reloadTime -- Tells how many seconds it takes to reload the weapon 
     10 *     int firingSpeed -- Tells how many seconds there are between shots 
     11 *     string name -- The name of the weapon 
     12 *     Image weaponImage -- The image of the *weapon*, which will (somehow) be added the character 
     13 *     Image bulletImage -- The image of the *bullet* 
     14 *     SoundEffect sound -- The sound that the weapon makes when fired (Reload soung is universal) 
     15 *  
     16 *     Note that the Images and SoundEffect are supplied as strings to the struct constructor 
     17 *  
     18 * Each struct shall follow these specifications*/ 
     19 
     20namespace Weapons 
    921{ 
     22    public Weapon Pistol() 
     23    { 
     24        return new Weapon( 
     25            0, 
     26            0, 
     27            "pistol", 
     28            "Images/gausspistol", 
     29            "" 
     30            "Sounds/pistolshot") 
     31    } 
    1032} 
Note: See TracChangeset for help on using the changeset viewer.