Axios-Tennis

Axios-Tennis Commit Details


Date:2012-04-17 23:32:00 (12 years 11 months ago)
Author:nathan@daedalus
Branch:newgsm
Commit:3a4cc24bb53e
Parents: 46452db1a858
Message:Testing out the new GSM, looks like everything is working except cursor.

I will merge back into Default once everything is 100% again.
Changes:
Aaxios_tennis/axios_tennisContent/background.png
Maxios_tennis.suo
Maxios_tennis/axios_tennis/Axios.Windows.dll
Maxios_tennis/axios_tennis/Credits.cs (2 diffs)
Maxios_tennis/axios_tennis/Game1.cs (2 diffs)
Maxios_tennis/axios_tennis/Objects/Ball.cs (4 diffs)
Maxios_tennis/axios_tennis/Objects/Paddle.cs (1 diff)
Maxios_tennis/axios_tennis/TennisScreen.cs (4 diffs)
Maxios_tennis/axios_tennis/axios_tennis.csproj (1 diff)
Maxios_tennis/axios_tennis/axios_tennis_wp7.csproj (1 diff)
Maxios_tennis/axios_tennis/axios_tennis_xbox360.csproj (1 diff)
Maxios_tennis/axios_tennisContent/axios_tennisContent.contentproj (1 diff)

File differences

axios_tennis/axios_tennis/Credits.cs
1212
1313
1414
15
15
1616
17
17
1818
1919
2020
......
7474
7575
7676
77
77
7878
7979
8080
        private Vector2 textpos;
        //private bool pause = false;
        public override void LoadContent()
        public override void  Activate(bool instancePreserved)
        {
            base.LoadContent();
            base.Activate(instancePreserved);
            StringBuilder sb = new StringBuilder();
            _credits_string = sb.ToString();
            textpos = new Vector2(-130, 0);
            sf = ScreenManager.Content.Load<SpriteFont>("Fonts/credits");
            sf = ScreenManager.Game.Content.Load<SpriteFont>("Fonts/credits");
        }
        public override void Update(GameTime gameTime, bool otherScreenHasFocus, bool coveredByOtherScreen)
axios_tennis/axios_tennis/Game1.cs
11
22
33
4
45
56
67
......
4243
4344
4445
45
46
4647
4748
48
49
4950
5051
5152
5253
5354
54
55
5556
56
57
57
58
5859
5960
6061
using FarseerPhysics.SamplesFramework;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using GameStateManagement;
namespace axios_tennis
{
            BackgroundScreen bg = new BackgroundScreen();
            MenuScreen ms = new MenuScreen("Axios Tennis");
            //MenuScreen ms = new MenuScreen("Axios Tennis");
            TennisScreen ts = new TennisScreen();
            Credits cd = new Credits();
            ms.AddMenuItem("", EntryType.Separator, null);
            /*ms.AddMenuItem("", EntryType.Separator, null);
            ms.AddMenuItem("", EntryType.Separator, null);
            ms.AddMenuItem("Start", EntryType.Screen, ts);
            ms.AddMenuItem("", EntryType.Separator, null);
            ms.AddMenuItem("Credits", EntryType.Screen, cd);
            ms.AddMenuItem("", EntryType.Separator, null);
            ms.AddMenuItem("Exit", EntryType.ExitItem, null);
            ms.AddMenuItem("Exit", EntryType.ExitItem, null);*/
            ScreenManager.AddScreen(bg);
            ScreenManager.AddScreen(ms);
            ScreenManager.AddScreen(bg, PlayerIndex.One);
            ScreenManager.AddScreen(new TennisMainMenu(), PlayerIndex.One);
        }
        /// <summary>
axios_tennis/axios_tennis/Objects/Ball.cs
66
77
88
9
910
1011
1112
......
2526
2627
2728
28
29
2930
3031
3132
......
5657
5758
5859
59
60
6061
6162
6263
......
7879
7980
8081
81
82
8283
8384
8485
85
86
87
8688
8789
8890
8991
90
92
9193
9294
9395
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using GameStateManagement;
namespace axios_tennis
{
        {
            base.LoadContent(gameScreen);
            this.ConstantVelocity = new Vector2(7f, 7f);
            this.Texture = gameScreen.ScreenManager.Content.Load<Texture2D>("ball");
            this.Texture = gameScreen.ScreenManager.Game.Content.Load<Texture2D>("ball");
            this.Origin = new Vector2(this.Texture.Width / 2, this.Texture.Height / 2);
            this.BodyPart = BodyFactory.CreateCircle(gameScreen.World, ConvertUnits.ToSimUnits(this.Texture.Width / 2), 1f);
        }
        public override void OnMouseDown(AxiosGameScreen gameScreen, InputHelper input)
        public override void OnMouseDown(AxiosGameScreen gameScreen, InputState input)
        {
            KickBall();
            base.OnMouseDown(gameScreen, input);
            this.BodyPart.LinearVelocity = Vector2.Zero;
            this.BodyPart.Inertia = 0f;
        }
        public override void HandleInput(AxiosGameScreen gameScreen, InputHelper input, GameTime gameTime)
        public override void HandleInput(AxiosGameScreen gameScreen, InputState input, GameTime gameTime)
        {
            base.HandleInput(gameScreen, input, gameTime);
            if (input.IsNewKeyPress(Keys.Space) || input.IsNewVirtualButtonPress(Buttons.A) || input.IsNewButtonPress(Buttons.A))
            PlayerIndex i;
            if (input.IsNewKeyPress(Keys.Space, PlayerIndex.One, out i) || input.IsNewVirtualButtonPress(Buttons.A) || input.IsNewButtonPress(Buttons.A, PlayerIndex.One, out i))
            {
                KickBall();
            }
            if (input.IsNewVirtualButtonPress(Buttons.B) || input.IsNewButtonPress(Buttons.B))
            if (input.IsNewVirtualButtonPress(Buttons.B) || input.IsNewButtonPress(Buttons.B, PlayerIndex.One, out i))
            {
                ResetBall();
            }
axios_tennis/axios_tennis/Objects/Paddle.cs
2323
2424
2525
26
26
2727
2828
2929
        {
            base.LoadContent(gameScreen);
            this.Texture = gameScreen.ScreenManager.Content.Load<Texture2D>("paddle");
            this.Texture = gameScreen.ScreenManager.Game.Content.Load<Texture2D>("paddle");
            this.Origin = new Vector2(this.Texture.Width / 2, this.Texture.Height / 2);
            this.BodyPart = BodyFactory.CreateRectangle(gameScreen.World, ConvertUnits.ToSimUnits(Texture.Width), ConvertUnits.ToSimUnits(Texture.Height), 1f);
axios_tennis/axios_tennis/TennisScreen.cs
55
66
77
8
9
10
811
912
1013
......
2831
2932
3033
34
35
3136
3237
33
38
3439
35
40
3641
37
42
3843
3944
4045
......
6065
6166
6267
63
68
6469
6570
6671
......
7176
7277
7378
74
79
7580
7681
7782
7883
7984
80
85
8186
82
87
8388
84
89
8590
8691
8792
8893
8994
9095
91
96
97
98
99
92100
93101
94102
95
103
104
105
106
96107
97108
98109
using Axios.Engine.Extenions;
using Axios.Engine.UI;
using Axios;
using System;
using GameStateManagement;
using Microsoft.Xna.Framework.Input;
namespace axios_tennis
{
            this.HasVirtualStick = true;
            this.HasCursor = true;
            EnableCameraControl = false;
            TransitionOnTime = TimeSpan.FromSeconds(1.5);
            TransitionOffTime = TimeSpan.FromSeconds(0.5);
        }
        public override void LoadContent()
        public override void  Activate(bool instancePreserved)
        {
            base.LoadContent();
         base.Activate(instancePreserved);
            int xcount, ycount;
            Texture2D _blocks = ScreenManager.Content.Load<Texture2D>("blocks");
            Texture2D _blocks = ScreenManager.Game.Content.Load<Texture2D>("blocks");
            Texture2D[,] _blocktextures = _blocks.Split(32, 32, 8, 8, out xcount, out ycount);
#if WINDOWS_PHONE
            _pwall = new Wall(new Vector2(-ConvertUnits.ToSimUnits(ScreenManager.GraphicsDevice.Viewport.Width) / 2f, 0), "pwall");
            _ewall = new Wall(new Vector2(ConvertUnits.ToSimUnits(ScreenManager.GraphicsDevice.Viewport.Width) / 2f, 0), "ewall");
            _sf = ScreenManager.Content.Load<SpriteFont>("scorefont");
            _sf = ScreenManager.Game.Content.Load<SpriteFont>("scorefont");
            _ppaddle.AllowAutomaticMouseJoint = true;
            AddGameObject(_ewall);
            AddGameObject(_ball);
        }
        void b_MouseDown(object sender, AxiosGameScreen gameScreen, InputHelper input)
        /*void b_MouseDown(object sender, AxiosGameScreen gameScreen, InputState input)
        {
            if (HasVirtualStick)
                HasVirtualStick = false;
            else
                HasVirtualStick = true;
        }
        }*/
        public override void HandleInput(InputHelper input, GameTime gameTime)
        public override void HandleInput(GameTime gameTime, InputState input)
        {
            base.HandleInput(input, gameTime);
            base.HandleInput(gameTime, input);
           
            //This must be handled in the screen because there are multiple paddles
           
            if (_ppaddle != null)
            {
                if (input.VirtualState.ThumbSticks.Left.Y > 0 || input.GamePadState.ThumbSticks.Left.Y > 0)
                if (input.VirtualState.ThumbSticks.Left.Y > 0 ||
                    input.CurrentGamePadStates[0].ThumbSticks.Left.Y > 0 ||
                    input.CurrentKeyboardStates[0].IsKeyDown(Keys.Down)
                    )
                {
                    _ppaddle.PaddleJoint.MotorSpeed = -40f;
                }
                else if (input.VirtualState.ThumbSticks.Left.Y < 0 || input.GamePadState.ThumbSticks.Left.Y < 0)
                else if (input.VirtualState.ThumbSticks.Left.Y < 0 ||
                    input.CurrentGamePadStates[0].ThumbSticks.Left.Y < 0 ||
                    input.CurrentKeyboardStates[0].IsKeyDown(Keys.Up)
                    )
                {
                    _ppaddle.PaddleJoint.MotorSpeed = 40f;
                }
axios_tennis/axios_tennis/axios_tennis.csproj
9898
9999
100100
101
101102
102103
103104
    <Compile Include="Objects\Border.cs" />
    <Compile Include="Objects\Paddle.cs" />
    <Compile Include="Objects\Wall.cs" />
    <Compile Include="TennisMainMenu.cs" />
    <Compile Include="TennisScreen.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
    <Compile Include="Program.cs" />
axios_tennis/axios_tennis/axios_tennis_wp7.csproj
8080
8181
8282
83
8384
8485
8586
    <Compile Include="Properties\AssemblyInfo.cs" />
    <Compile Include="Program.cs" />
    <Compile Include="Game1.cs" />
    <Compile Include="TennisMainMenu.cs" />
    <Compile Include="TennisScreen.cs" />
  </ItemGroup>
  <ItemGroup>
axios_tennis/axios_tennis/axios_tennis_xbox360.csproj
7676
7777
7878
79
7980
8081
8182
    <Compile Include="Properties\AssemblyInfo.cs" />
    <Compile Include="Program.cs" />
    <Compile Include="Game1.cs" />
    <Compile Include="TennisMainMenu.cs" />
    <Compile Include="TennisScreen.cs" />
  </ItemGroup>
  <ItemGroup>
axios_tennis/axios_tennisContent/axios_tennisContent.contentproj
189189
190190
191191
192
193
194
195
196
197
198
192199
193200
194201
<Processor>TextureProcessor</Processor>
</Compile>
</ItemGroup>
<ItemGroup>
<Compile Include="background.png">
<Name>background</Name>
<Importer>TextureImporter</Importer>
<Processor>TextureProcessor</Processor>
</Compile>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

Archive Download the corresponding diff file

Branches

Tags

Page rendered in 0.71621s using 13 queries.