Jump to content

News Reporters - Discuții / Discussions


Alexander
 Share

Recommended Posts

Acum am terminat si eu de invatat 8-| deja urasc germana, Bmw imi cer scuze ca nu te-am putut ajuta la simulare dar atunci nu eram la calculator sa-ti raspund :(.

Edited by RazviTnx
Link to comment
Share on other sites

Ma arunc si eu la somn, noapte buna mai vorbim si maine.

 

Noapte buna!

Si eu ar trebui sa merg... mai stau 5 minute cred

 

Am nevoie de niste pareri, quote

 

 

Platforma_2013_02_20_22_29_19_02.jpg

 

Platforma_2013_02_20_22_29_33_88.jpg

 

Platforma_2013_02_20_22_29_36_32.jpg

 

Platforma_2013_02_20_22_29_37_41.jpg

 

Platforma_2013_02_20_22_29_41_84.jpg

 

 

free image hosting

 

cum e?

Edited by ZIUA VERDE
Link to comment
Share on other sites

Pentru inceput mie mi se pare foarte fain. Continua .

 

Nu e chiar inceput :))

 

 

 


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace Platforma
{
   public class Background
   {

       public Texture2D textura, fulger;
       public Vector2 pozitie1,pozitie2;
       public Rectangle dr1,dr2;
       public int viteza = 5;
       public bool on = true;

       public Background()
       {

       }
       public void Update(GameTime gameTime)
       {
           if (on)
           {
               dr1 = new Rectangle((int)pozitie1.X, (int)pozitie1.Y, Game1.x, Game1.y);
               dr2 = new Rectangle((int)pozitie2.X, (int)pozitie2.Y, Game1.x, Game1.y);
               pozitie1.Y += viteza;
               pozitie2.Y += viteza;
               if (pozitie1.Y >= Game1.y)
               {
                   pozitie1.Y = 0;
                   pozitie2.Y = Game1.y * -1;
               }
           }

       }
       public void LoadContent(ContentManager Content)
       {
           pozitie1 = new Vector2(0, 0);
           pozitie2 = new Vector2(0, Game1.y * -1);
           textura = Content.Load<Texture2D>("resurse/bg");
           dr1 = new Rectangle((int)pozitie1.X, (int)pozitie1.Y, Game1.x, Game1.y);
           dr2 = new Rectangle((int)pozitie2.X, (int)pozitie2.Y, Game1.x, Game1.y);
       }

       public void Draw(SpriteBatch spriteBatch)
       {
           spriteBatch.Draw(textura, dr1, Color.Wheat);
           spriteBatch.Draw(textura, dr2, Color.Wheat);

       }

   }
}

using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using System.IO;

namespace Platforma
{
  public class Bila
   {

       SpriteFont font;
       public Texture2D textura;
       public Vector2 pozitie;
       public  Color[] culori;
      public  Rectangle dreptunghi;
       public int viteza1,viteza2,px;
       public bool vizibil=true;
       public float rotatie = 0f;

      public Bila()
      {



          pozitie = new Vector2(Game1.x/2, Game1.y/2);

          viteza1 =-1;
          viteza2 =- 1;
          px = 5;

      }
      public void LoadContent(ContentManager Content)
      {
          font = Content.Load<SpriteFont>("resurse/SpriteFont1");
          //textura primeste imaginea din resurse
          textura = Content.Load<Texture2D>("resurse/minge");
          //stabilim pozitia mingii
          pozitie = new Vector2(Game1.graphics.PreferredBackBufferWidth / 2, Game1.graphics.PreferredBackBufferHeight / 2);
          dreptunghi = new Rectangle((int)pozitie.X, (int)pozitie.Y, textura.Width, textura.Height);


      }

      public void Draw(SpriteBatch spriteBatch)
      {
          spriteBatch.Draw(textura, dreptunghi, null, Color.White, rotatie, new Vector2(textura.Width / 2, textura.Height / 2), SpriteEffects.None, 0);



      }

      public void Update(GameTime gameTime)
      {
          // miscarea bilei
          rotatie += 0.05f;

          pozitie.X += px * viteza1;
          pozitie.Y += px * viteza2;

          if (pozitie.X >= Game1.graphics.PreferredBackBufferWidth - textura.Width)
          {
              viteza1 *= -1;
          }
          if (pozitie.X <= 0)
          {
              viteza1 *= -1;

          }
          if (pozitie.Y >= Game1.graphics.PreferredBackBufferHeight)
          {
              #region salvam scorurile actuale
              StreamReader ra = new StreamReader("set.ini");
              for (int i = 1; i <= 8; i++)
                 ra.ReadLine();
              string[] scoruri = new string[11];
              StreamWriter op = new StreamWriter("test.txt");
              for (int i = 1; i <= 10; i++)
              {
                  scoruri[i] = "A";
                  scoruri[i] = ra.ReadLine();
                  op.WriteLine(scoruri[i]);
              }
              op.Close();
              ra.Close();
              #endregion

              StreamReader sr = new StreamReader("set.ini");
              string[] setari = new string[9];
              for (int i = 1; i <= 8; i++)
                  setari[i] = sr.ReadLine();

              for (int i = 1; i <= 10; i++)
              {
                  int scor, level;
                  string data;
                  string aux = "";

                  int litera = sr.Read();
                  while (litera != 32)
                  {
                      aux += (char)litera;
                      litera = sr.Read();
                  }
                  sr.ReadLine();
                  scor = Convert.ToInt32(aux);
                  if (Joc.scor > scor)
                  {
                      sr.Close();

                      StreamWriter s = new StreamWriter("set.ini");

                      for (int j = 1; j <= 8; j++)
                          s.WriteLine(setari[j]);

                      for (int j = 1; j < i; j++)
                      {
                          s.WriteLine(scoruri[j]);
                      }
                      s.WriteLine(Joc.scor + " " + Joc.level + " " + DateTime.Now.ToString());
                      for (int j = i + 1; j <= 10; j++)
                      {
                          s.WriteLine(scoruri[j-1]);
                      }
                      s.Close();
                      break;




                  }
              }








              Mainmenu.meniu_optiuni = false;
              Mainmenu.meniu_topscor = false;
                 Joc.activ=false;
                 Joc.mainmenu = true;
                 Mainmenu.meniu_principal = true;





          }
          if (pozitie.Y <= 0)
          {
              viteza2 *= -1;

          }
          // stabilim culorile pentru a determina coliziunea
          culori = new Color[textura.Height * textura.Width];
          textura.GetData(culori);
          // dreptunghiul primeste coordonatele unui vector
          dreptunghi = new Rectangle((int)pozitie.X, (int)pozitie.Y, textura.Width, textura.Height);




      }
   }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace Platforma
{
   public class Coliziuni
   {
       static bool Pix(Rectangle rect1, Color[] data1, Rectangle rect2, Color[] data2)
       {
           int Top = Math.Max(rect1.Top, rect2.Top);
           int Bottom = Math.Min(rect1.Bottom, rect2.Bottom);
           int Left = Math.Max(rect1.Left, rect2.Left);
           int Right = Math.Min(rect1.Right, rect2.Right);

           for (int y = Top; y < Bottom; y++)
               for (int x = Left; x < Right; x++)
               {
                   Color color1 = data1[(x - rect1.Left) + (y - rect1.Top) * rect1.Width];
                   Color color2 = data2[(x - rect2.Left) + (y - rect2.Top) * rect2.Width];
                   if (color1.A != 0 && color2.A != 0)
                       return true;
               }
           return false;
       }
       public Coliziuni()
       {

       }
       bool atinge = false;
       public void Update(GameTime gameTime)
       {
           // verificam coliziunea dintre bila si player


           if (!Pix(Game1.p.dreptunghi, Game1.p.culori, Game1.b.dreptunghi, Game1.b.culori))
               atinge = false;
           if (!atinge)
               if (Pix(Game1.p.dreptunghi, Game1.p.culori, Game1.b.dreptunghi, Game1.b.culori))
               {
                   atinge = true;
                  // Game1.b.viteza1 *= -1;
                   Game1.b.viteza2 *= -1;
                   Player.liber = true;

               }
       }
   }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace Platforma
{
   public class Cutie1
   {


       public Texture2D textura, cut1, cut2;
      public Vector2 pozitie;
      public  Color[] culori;
      public  Rectangle dreptunghi;
      public int viteza;
      public bool vizibil;
      public int tip;


      public Cutie1(int x,int y,int fel)
      {

          // fel 1 = normal, se sparge
          // fel 2 = mai gros se tr in fel 1
          // fel 3 = si mai gros se tr in fel 2
          // fel 4 si mai gros , se invarte se trans in fel 3
          textura = null;
          tip = fel;
          pozitie = new Vector2(x, y);

          viteza = 5;
          vizibil = true;


      }

      public void LoadContent(ContentManager Content)
      {

          //textura primeste imaginea din resurse
          textura = Content.Load<Texture2D>("resurse/cutie");
          cut1 = Content.Load<Texture2D>("resurse/cutie");
          cut2 = Content.Load<Texture2D>("resurse/cutie2");

          //stabilim pozitia player-ului
        //  pozitie = new Vector2(Game1.x/2, Game1.y/4f);
          dreptunghi = new Rectangle((int)pozitie.X, (int)pozitie.Y, textura.Width, textura.Height);

      }

      public void Draw(SpriteBatch spriteBatch)
      {
          if (vizibil)
          {

                  spriteBatch.Draw(textura, dreptunghi, Color.Wheat);
          }
      }

      public void Update(GameTime gameTime)
      {

          if (tip == 1)
          {
              if (textura != Texturi.cut1)
                  textura = Texturi.cut1;
          }
          if (tip ==2)
          {
              if (textura != Texturi.cut2)
                  textura = Texturi.cut2;
          }
          if (tip == 3)
          {
              if (textura != Texturi.cut3)
                  textura = Texturi.cut3;
          }
          if (tip == 4)
          {

              if (textura != Texturi.cut4)
                  textura = Texturi.cut4;
          }
          // stabilim culorile pentru a determina coliziunea


              culori = new Color[textura.Height * textura.Width];
              textura.GetData(culori);

          // dreptunghiul primeste coordonatele unui vector
          dreptunghi = new Rectangle((int)pozitie.X, (int)pozitie.Y, textura.Width, textura.Height);



      }
   }
}

using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using System.IO;
namespace Platforma
{
   /// <summary>
   /// This is the main type for your game
   /// </summary>
   /// 



   public class Game1 : Microsoft.Xna.Framework.Game
   {

       static bool Pix(Rectangle rect1, Color[] data1, Rectangle rect2, Color[] data2)
       {
           int Top = Math.Max(rect1.Top, rect2.Top);
           int Bottom = Math.Min(rect1.Bottom, rect2.Bottom);
           int Left = Math.Max(rect1.Left, rect2.Left);
           int Right = Math.Min(rect1.Right, rect2.Right);

           for (int y = Top; y < Bottom; y++)
               for (int x = Left; x < Right; x++)
               {
                   Color color1 = data1[(x - rect1.Left) + (y - rect1.Top) * rect1.Width];
                   Color color2 = data2[(x - rect2.Left) + (y - rect2.Top) * rect2.Width];
                   if (color1.A != 0 && color2.A != 0)
                       return true;
               }
           return false;
       }
       #region .
       /*
       bool atingere = false;
       bool atingere2 = false;
       bool cutia1 = true;
       SpriteFont font;
     * 
     * */


       /*
       Texture2D minge;
       Color[] minge_color;
       int minge_x = 0;
       int minge_y = 0;
       Rectangle minge_rect;

       Texture2D cutie1;
       Color[] cutie1_color;
       int cutie1_x = 0;
       int cutie1_y = 0;
       Rectangle cutie1_rect;

       Texture2D bara;
       Color[] bara_color;
       int bara_x = 0;
       int bara_y = 0;
       Rectangle bara_rect;

       int viteza1, viteza2;
        * 
        * */
       #endregion
       public static GraphicsDeviceManager graphics;
       SpriteBatch spriteBatch;

      public static Player p = new Player();
      public static Bila b = new Bila();
      public static Background bg = new Background();
      Color culoare_text = Color.White;
      public static Color culoare_bg = Color.Black;

      Coliziuni coliziuni = new Coliziuni();
       // rezolutia
       public static int x = 1152, y = 864;
      //public static int x = 1280, y = 1024;
       public bool atinge = false;
       public Game1()
       {
           graphics = new GraphicsDeviceManager(this);
           if (!File.Exists("set.ini"))
           {
               StreamWriter op = new StreamWriter("set.ini");
               op.WriteLine("1152");
               op.WriteLine("864");
               op.WriteLine("True"); // audio
               op.WriteLine("False"); // full screen
               op.WriteLine("1"); // 1 = maus 2== tastatura
               op.WriteLine("37"); // stanga
               op.WriteLine("39"); // dreapta
               op.WriteLine("5"); // sensibilitate
               for(int i=1;i<=10;i++)
               {
                   op.WriteLine("0 0 "+DateTime.Now.ToString());
               }

               op.Close();
           }
           else
           {
               StreamReader si = new StreamReader("set.ini");
               x = Convert.ToInt32(si.ReadLine());
               y = Convert.ToInt32(si.ReadLine());
               Joc.audio = Convert.ToBoolean(si.ReadLine());
               Joc.fullscreen = Convert.ToBoolean(si.ReadLine());
               si.Close();
           }
           graphics.PreferredBackBufferHeight = y;
           graphics.PreferredBackBufferWidth =x;
           Content.RootDirectory = "Content";
           this.window.Title = "Super joc";
       }

       protected override void Initialize()
       {

           base.Initialize();
       }



       protected override void LoadContent()
       {




           #region .
           /*
           viteza1 = 1; viteza2 = 1;
           minge_x = graphics.PreferredBackBufferWidth/2;
           minge_y = graphics.PreferredBackBufferHeight / 2;
           minge=Content.Load<Texture2D>("resurse/minge");
          font = Content.Load<SpriteFont>("resurse/SpriteFont1");
           minge_rect = new Rectangle(minge_x, minge_y, minge.Width, minge.Height);

           bara_x = graphics.PreferredBackBufferWidth / 2;
           bara_y = (int)(graphics.PreferredBackBufferHeight / 1.2);
           bara = Content.Load<Texture2D>("resurse/bara");
           bara_rect = new Rectangle(bara_x, bara_y, bara.Width, bara.Height);

           cutie1_x = graphics.PreferredBackBufferWidth / 3;
           cutie1_y = (int)(graphics.PreferredBackBufferHeight / 8);
           cutie1 = Content.Load<Texture2D>("resurse/bara");
           cutie1_rect = new Rectangle(cutie1_x, cutie1_y, cutie1.Width, cutie1.Height);
           */
           #endregion
           Texturi.LoadContent(Content);
           spriteBatch = new SpriteBatch(GraphicsDevice);
           bg.LoadContent(Content);
           p.LoadContent(Content);
           b.LoadContent(Content);




       }

       protected override void UnloadContent()
       {

       }
       protected override void Update(GameTime gameTime)
       {

           if (Joc.pauza)
           {
               Game1.bg.on = false;
              Pauza.Update(gameTime);
           }
           else
           {
               Game1.bg.on = true;
           }

           if (Joc.activ)
           {
               if (Keyboard.GetState().IsKeyDown(Keys.Escape))
               {
                   Joc.activ = false;
                   Joc.pauza = true;
                   Pauza.meniu_principal = true;
               }
           }
           if (Joc.iesire)
               this.Exit();

           if (Joc.fullscreen)
           {
               if (!graphics.IsFullScreen)
                   graphics.IsFullScreen = true;
           }
           else
               if (graphics.IsFullScreen)
                   graphics.IsFullScreen = false;
           bg.Update(gameTime);


               Mainmenu.Update(gameTime);

           if (Joc.activ)
           {

               if (Joc.scor == 0)
                   culoare_text = Color.White;
               if (Joc.scor > 0)
                   culoare_text = Color.DeepSkyBlue;
               if (Joc.scor < 0)
                   culoare_text = Color.Red;


               p.Update(gameTime);

               b.Update(gameTime);

               coliziuni.Update(gameTime);

           }

           base.Update(gameTime);
       }

       protected override void Draw(GameTime gameTime)
       {
           GraphicsDevice.Clear(Color.Black);
           spriteBatch.Begin();
           bg.Draw(spriteBatch);
           spriteBatch.End();
           if (!Joc.mainmenu)
           {
               GraphicsDevice.Clear(culoare_bg);

               spriteBatch.Begin();
               bg.Draw(spriteBatch);

               p.Draw(spriteBatch);
               b.Draw(spriteBatch);
               spriteBatch.DrawString(Texturi.font, Joc.scor.ToString() + Environment.NewLine + Joc.level.ToString(), new Vector2(1, 1), culoare_text);


               spriteBatch.End();
           }
           else
           {
               Mainmenu.Draw(spriteBatch);
           }
           if (Joc.pauza)
           {
              Pauza.Draw(spriteBatch);
           }
           base.Draw(gameTime);
       }
   }
}

 

 

 

Uite doar un sfert din tot jocul :))

Link to comment
Share on other sites

Ma duc sa ma culc. Sa ghicesc, maine stau acasa :)) vineri ma duc la scoala ca am ore usoare =))

 

Cum m-am descurcat la simulare BMW :) ?

 

Asta-i pagina mea

Edited by JusT XeS
Link to comment
Share on other sites

S-a cam dus calculatorul meu :))

 

Ecranul (laptop-ului) s-a desprins dintr-o parte si sta agatat doar din partea stanga. Rama ecranului a ramas agatata de partea dreapta si s-a desprins de ecran. Pe spate, este crapat in locul unde s-a desprins si mereu cand vreau sa il inchid sau sa il deschid trebuie sa fixez rama de ecran ca altfel se rupe.

Edited by adrianopol
Link to comment
Share on other sites

  • psoN changed the title to Discuții / Discussions
  • E l e g a n t locked this topic
  • .Aku unlocked and locked this topic
  • .Aku unlocked this topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.