Changeset 4353 for 2013


Ignore:
Timestamp:
2013-07-02 14:18:37 (10 years ago)
Author:
jumakall
Message:
 
Location:
2013/27/TeemuM/Game
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • 2013/27/TeemuM/Game/Game/Game/Game.cs

    r4352 r4353  
    77using Jypeli.Widgets; 
    88 
    9 public class Game : PhysicsGame 
     9public class G : PhysicsGame 
    1010{ 
     11    public static G game; 
     12    public Image playerImage = LoadImage("Player"); 
     13 
    1114    public override void Begin() 
    1215    { 
    13         Player pelaaja = new Player(50, 50); 
     16        game = this; 
     17 
     18        Player pelaaja = new Player(this, 50, 50); 
    1419        Add(pelaaja); 
    1520 
    1621        PhoneBackButton.Listen(Exit, "Lopeta peli"); 
    1722        Keyboard.Listen(Key.Escape, ButtonState.Pressed, Exit, "Lopeta peli"); 
     23 
     24        Mouse.IsCursorVisible = true; 
     25    } 
     26 
     27    protected override void Update(Microsoft.Xna.Framework.GameTime gameTime) 
     28    { 
     29 
     30        base.Update(gameTime); 
    1831    } 
    1932} 
  • 2013/27/TeemuM/Game/Game/Game/Ohjelma.cs

    r4352 r4353  
    66    static void Main(string[] args) 
    77    { 
    8         using (Game game = new Game()) 
     8        using (G game = new G()) 
    99        { 
    1010#if !DEBUG 
  • 2013/27/TeemuM/Game/Game/Game/Player.cs

    r4352 r4353  
    11using System; 
    22using System.Collections.Generic; 
    3 using System.Linq; 
    4 using System.Text; 
    53using Jypeli; 
    64using Jypeli.Assets; 
     
    97using Jypeli.Widgets; 
    108 
    11 public class Player : PlatformCharacter 
     9public class Player : PhysicsObject 
    1210{ 
    13     public Player(double width, double height) : base(width, height) 
     11    const double defaultMoveSpeed = 1000; 
     12    double speed = defaultMoveSpeed; 
     13 
     14    public Player(Game game, double width, double height) : base(width, height) 
     15    { 
     16        this.Shape = Shape.Circle; 
     17        this.Image = G.game.playerImage; 
     18        this.LinearDamping = 0.9; 
     19         
     20        SetControls(); 
     21        IsUpdated = true; 
     22    } 
     23 
     24    public void SetControls() 
     25    { 
     26        G.game.Keyboard.Listen(Key.W, ButtonState.Down, delegate { this.Push(new Vector(0, speed)); }, null); 
     27        G.game.Keyboard.Listen(Key.S, ButtonState.Down, delegate { this.Push(new Vector(0, -speed)); }, null); 
     28        G.game.Keyboard.Listen(Key.A, ButtonState.Down, delegate { this.Push(new Vector(-speed, 0)); }, null); 
     29        G.game.Keyboard.Listen(Key.D, ButtonState.Down, delegate { this.Push(new Vector(speed, 0)); }, null); 
     30        G.game.Mouse.Listen(MouseButton.Left, ButtonState.Pressed, Shoot, null); 
     31    } 
     32 
     33    public void Shoot() 
    1434    { 
    1535 
    1636    } 
     37 
     38    public override void Update(Time time) 
     39    { 
     40        this.Angle = (G.game.Mouse.PositionOnWorld - this.AbsolutePosition).Normalize().Angle - Angle.FromDegrees(90); 
     41        base.Update(time); 
     42    } 
    1743} 
  • 2013/27/TeemuM/Game/Game/Game/obj/x86/Debug/ContentPipeline-{7DE21D26-C0FA-4B3B-93A6-C0EF7849F918}.xml

    r4352 r4353  
    22<XnaContent xmlns:Pipeline="Microsoft.Xna.Framework.Content.Pipeline"> 
    33  <Asset Type="Pipeline:BuildItemCollection"> 
     4    <Item> 
     5      <Source>Player.png</Source> 
     6      <Name>Player</Name> 
     7      <Importer>TextureImporter</Importer> 
     8      <Processor>TextureProcessor</Processor> 
     9      <Options>None</Options> 
     10      <Output>C:\MyTemp\jumakall\TeemuM\Game\Game\Game\bin\x86\Debug\Content\Player.xnb</Output> 
     11      <Time>2013-07-02T13:02:38.9536571+03:00</Time> 
     12    </Item> 
    413    <BuildSuccessful>true</BuildSuccessful> 
    514    <Settings> 
     
    918      <BuildConfiguration>Debug</BuildConfiguration> 
    1019      <CompressContent>false</CompressContent> 
    11       <RootDirectory>C:\MyTemp\jumakall\jumakall\Game\Game\GameContent\</RootDirectory> 
    12       <LoggerRootDirectory>C:\MyTemp\jumakall\jumakall\Game\Game\Game\</LoggerRootDirectory> 
    13       <IntermediateDirectory>C:\MyTemp\jumakall\jumakall\Game\Game\Game\obj\x86\Debug\</IntermediateDirectory> 
    14       <OutputDirectory>C:\MyTemp\jumakall\jumakall\Game\Game\Game\bin\x86\Debug\Content\</OutputDirectory> 
     20      <RootDirectory>C:\MyTemp\jumakall\TeemuM\Game\Game\GameContent\</RootDirectory> 
     21      <LoggerRootDirectory>C:\MyTemp\jumakall\TeemuM\Game\Game\Game\</LoggerRootDirectory> 
     22      <IntermediateDirectory>C:\MyTemp\jumakall\TeemuM\Game\Game\Game\obj\x86\Debug\</IntermediateDirectory> 
     23      <OutputDirectory>C:\MyTemp\jumakall\TeemuM\Game\Game\Game\bin\x86\Debug\Content\</OutputDirectory> 
    1524    </Settings> 
    1625    <Assemblies> 
     26      <Assembly> 
     27        <Key>C:\Program Files (x86)\Jypeli\lib\ContentExtensions\TextFileContentExtension.dll</Key> 
     28        <Value>2013-06-10T21:54:20+03:00</Value> 
     29      </Assembly> 
     30      <Assembly> 
     31        <Key>C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Content.Pipeline.XImporter.dll</Key> 
     32        <Value>2011-09-01T17:22:30+03:00</Value> 
     33      </Assembly> 
     34      <Assembly> 
     35        <Key>C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Content.Pipeline.VideoImporters.dll</Key> 
     36        <Value>2011-09-01T17:22:30+03:00</Value> 
     37      </Assembly> 
     38      <Assembly> 
     39        <Key>C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Content.Pipeline.TextureImporter.dll</Key> 
     40        <Value>2011-09-01T17:22:30+03:00</Value> 
     41      </Assembly> 
     42      <Assembly> 
     43        <Key>C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Content.Pipeline.FBXImporter.dll</Key> 
     44        <Value>2011-09-01T17:22:30+03:00</Value> 
     45      </Assembly> 
     46      <Assembly> 
     47        <Key>C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Content.Pipeline.EffectImporter.dll</Key> 
     48        <Value>2011-09-01T17:22:30+03:00</Value> 
     49      </Assembly> 
     50      <Assembly> 
     51        <Key>C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Content.Pipeline.AudioImporters.dll</Key> 
     52        <Value>2011-09-01T17:22:30+03:00</Value> 
     53      </Assembly> 
     54      <Assembly> 
     55        <Key>C:\Program Files (x86)\Jypeli\lib\ContentExtensions\AnimationExtension.dll</Key> 
     56        <Value>2013-06-10T21:54:20+03:00</Value> 
     57      </Assembly> 
    1758      <Assembly> 
    1859        <Key>C:\Windows\Microsoft.Net\assembly\GAC_32\Microsoft.Xna.Framework.Content.Pipeline\v4.0_4.0.0.0__842cf8be1de50553\Microsoft.Xna.Framework.Content.Pipeline.dll</Key> 
  • 2013/27/TeemuM/Game/Game/Game/obj/x86/Debug/Game.csproj.FileListAbsolute.txt

    r4352 r4353  
    77C:\MyTemp\jumakall\jumakall\Game\Game\Game\obj\x86\Debug\Game.exe 
    88C:\MyTemp\jumakall\jumakall\Game\Game\Game\obj\x86\Debug\Game.pdb 
     9C:\MyTemp\jumakall\TeemuM\Game\Game\Game\bin\x86\Debug\Game.exe 
     10C:\MyTemp\jumakall\TeemuM\Game\Game\Game\bin\x86\Debug\Game.pdb 
     11C:\MyTemp\jumakall\TeemuM\Game\Game\Game\bin\x86\Debug\Jypeli.dll 
     12C:\MyTemp\jumakall\TeemuM\Game\Game\Game\bin\x86\Debug\Jypeli.xml 
     13C:\MyTemp\jumakall\TeemuM\Game\Game\Game\obj\x86\Debug\ResolveAssemblyReference.cache 
     14C:\MyTemp\jumakall\TeemuM\Game\Game\Game\obj\x86\Debug\Microsoft.Xna.Framework.RuntimeProfile.txt 
     15C:\MyTemp\jumakall\TeemuM\Game\Game\Game\obj\x86\Debug\Game.exe 
     16C:\MyTemp\jumakall\TeemuM\Game\Game\Game\obj\x86\Debug\Game.pdb 
     17C:\MyTemp\jumakall\TeemuM\Game\Game\Game\bin\x86\Debug\Content\Player.xnb 
  • 2013/27/TeemuM/Game/Game/GameContent/GameContent.contentproj

    r4352 r4353  
    4545    <Reference Include="AnimationExtension" /> 
    4646  </ItemGroup> 
     47  <ItemGroup> 
     48    <Compile Include="Player.png"> 
     49      <Name>Player</Name> 
     50      <Importer>TextureImporter</Importer> 
     51      <Processor>TextureProcessor</Processor> 
     52    </Compile> 
     53  </ItemGroup> 
    4754  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    4855  <!--  To modify your build process, add your task inside one of the targets below and uncomment it.  
  • 2013/27/TeemuM/Game/Game/GameContent/obj/x86/Debug/GameContent.contentproj.FileListAbsolute.txt

    r4352 r4353  
    11C:\MyTemp\jumakall\jumakall\Game\Game\GameContent\obj\x86\Debug\ResolveAssemblyReference.cache 
     2C:\MyTemp\jumakall\TeemuM\Game\Game\GameContent\obj\x86\Debug\ResolveAssemblyReference.cache 
Note: See TracChangeset for help on using the changeset viewer.