EXAMENUL PENTRU CERTIFICAREA COMPETENŢELOR …



COLEGIUL NATIONAL „TUDOR VLADIMIRESCU”

TÂRGU-JIU

Proiect

de atestare profesională la informatică

Profesor îndrumător: Absolvent:

Nodea Eugen Ușurelu Florian Robert

Clasa: XII A

~ 2019 ~

ÎN ÎNVĂŢĂMÂNTUL LICEAL

Anexa 1

Unitatea de învăţământ : COLEGIUL NAŢIONAL „TUDOR VLADIMIRECU” Tg- Jiu

Anul şcolar 2018/2019

REFERAT

ASUPRA PROIECTULUI REALIZAT DE ELEVUL (ELEVA)

____________________________________________________________________

CLASA a XII-a ___

Denumirea temei _____________________________________________________

1. Nivelul documentării

|Insuficient |Satisfăcător |Bun |Foarte Bun |

2. Unitate

|Soft educaţional |Utilitar |Altele |

3. Redactarea lucrării

|Suficient |Bună |Foarte bună |

4. Partea grafică, desene

|Suficient |Bună |Foarte bună |

5. Realizare practică

- complexitate

|Simplu |Mediu |Complex |

- funcţionare

|DA |NU |

6. Bibliografie

- cărţi de specialitate

- manuale

- reviste de specialitate

Concluzia : Se propune nota/calificativul : ___________

Profesor îndrumător,

Prof. ____________________

TEMA

Psihologia umana

Cuprins

• Motivarea alegerii temei

• Descrierea aplicației

• Codul sursă al programului

• Concluzii

• Bibliografie

• Anexe

Motivarea alegerii temei

Am ales aceasta temă pentru ca mereu am fost fascinat de omul ca entitate si deciziile sale.

Omul este cea mai avansata creatura, deci implicit cea ce venerează planeta și îi influentează traiectoria.

După cum știm, omul este o ființă socială ce poate evolua doar într-o comunitate și se folosește pentru supraviețuire si prosperitate de descoperirile predecesorilor săi. Tema a fost practic un exercițiu de imaginatie, aplicația oferind un joc în care pune la încercare atât cultura generală a individului cât și viziunea sa, talentul de a prezice cum se poate distorsiona prezentul, alterând decizii din trecut.

În atestat sunt adresate utilizatorului în jocul „Traveler” întrebări de tipul: „ai opri pesonajul istoric X din a face Y ?”. Un exemplu bun este urmatorul; am introdus în joc o întrebare referitoare la stoparea papei din a alunga toate pisicile din zona respectiva în epoca întunecată. Din punct de vedere istoric, papa a alungat pisicile pe motiv că sunt animalele diavolului, însă aceasta a reprezentat o decizie neinspirata. În epoca întunecată, una din cele mai mari probleme a societății era ciuma. Ciuma era răspândită de șobolani. Pisicile vânau șobolanii. Din această înșiruire de idei putem trage concluzia că pisicile stopau răspândirea ciumei prin stoparea șobolanilor. Această decizie practic a decimat populația. Revenind la joc: dacă jucătorul îl va opri pe papă din alungarea pisicilor, va lua o decizie importantă ce va distorsiona prezentul, iar jocul este programat să-l distorsioneze într-un mod pozitiv.

De ce am ales tocmai această temă totuși? Am ales această tema pentru că am conceput atestatul in luna ianuarie, după revelionul 2019 petrecut cu un grup de persoane dintre care și un adept al influencer-ului polonez Gary Vaynerchuk care mi-a prezentat aspecte din viața lui Gary. Am învățat din experiența de viață cât de radical se poate schimba soarta unei persoane, societăți cu ajutorul unor decizii inspirate, practic jocul „Traveler” necesitând inspirație, soarta prezentului fiind decisă de o analiză amănunțită a situațiilor prezentate.

Atestatul a fost conceput implicând trei personaje ce au făcut parte din viața mea de licean. Implicați în mod direct au fost Stochițoiu Radu, prezent la nivelul „Master” din jocul „Survival”, pentru ca în 2019 este la master la UPB și Noroc Andrei la nivelul „Lucky”. Indirect a fost implicat Andrei Mărgeloiu prin prezentarea lui Gary V., aplicația practic având firul narativ legat de Gary, numele aplicației fiind întocmai Gary V.

Jocul „Traveler” este practic motivul pentru care atestatul are tema „Psihologia umană”, jocul generând la final o listă cu rezultatele decizilor luate de-a lungul jocului.

Descrierea aplicației

Aplicația a fost realizată în Visual Studio în C#. Imaginile au fost editate in Paint si Pixlr, de altfel toate imaginile sunt din desenul animat „Adventure Time”, desen reprezentativ nu doar în viata subsemnatului.

Melodiile de fundal sunt din serialul Game of Thrones și din jocul Metin2.

Aplicația constă în două jocuri: primul joc nu reprezintă prea mult tema atestatului, însă a fost nevoie de destul de multe linii de cod pentru a-l concepe și a fost legat de jocul al 2-lea prin povestea din spatele aplicației. Povestea este în engleză (de altfel tot atestatul), aceasta aflându-se în secțiunea „Story”.

Toate formurile aplicației sunt concepute cu butonul „prev” ce duc la formul anterior, unele fiind concepute, depinde de caz, și cu butonul „next”.

Pagina principala este practic meniul aplicației ce duce la meniurile celor două jocuri, dar și la alte informații ca: secțiunea despre atestat, reguli sau story. Toate meniurile sunt prevăzute cu butonu ON/OFF pentru sunet.

O caracteristică, să zicem curioasă, referitor la atestat este faptul că pentru jocul „Traveler” a trebuit să stochez răspunsurile la întrebările adresate în joc, însă nu știam cum să fac asta. Am găsit tutorial pe youtube cum să citesc si să scriu dintr-un notepad un singur număr, însă eu aveam nevoie să mă folosesc de 20 de numere pentru a contoriza răspunsurile celor 20 de întrebări. Din fericire, raspunsurile pot lua două stări: DA sau NU. Practic, pentru întrebarea a i-a, am codificat în singurul număr pe care-l știam să-l citesc din notepad, al i-lea bit cu 1 pentru starea DA si 0 pentru starea NU. La finalul jocului, verificam fiecare bit ce stare are pentru contorizarea rezultatului.

Jocul „Traveler” este practic piesa de rezistență a atestatului. De ce? Inițial, ai 2 parametri: coeficientul de evoluție al societății și anul apocaliptic. Coeficienții vor fi crescuți sau scăzuți în funcție de răspunsurile jucătorilor. De exemplu, coeficientul de evolutie pleacă inițial de la cota 70 de la 0 la 100. Dacă jucătorul va lua decizile exact cum au fost luate de-a lungul istoriei, această cotă nu se va schimba. Pentru fiecare întrebare, se va genera un scenariu pentru acea întrebare (o propoziție despre prezentul generat de decizile jucătorului). Cum fiecare întrebarea are câte două răspunsuri, iar numărul întrebărilor este de 20, se vor putea genera 2^20 scenarii posibile diferite, adică 1048576 scenarii.

Mai jos se află poze cu fiecare fereastră din aplicație.

[pic]

[pic]

[pic]

[pic]

[pic][pic]

[pic][pic]

[pic][pic][pic][pic][pic][pic]

[pic][pic]

[pic][pic]

[pic][pic]

[pic][pic]

[pic][pic]

[pic][pic]

[pic][pic]

[pic][pic]

[pic]

[pic]

[pic][pic]

[pic][pic]

[pic]

Codul sursă al atestatului se află mai jos:

Pentru pagina principală:

using System;

using System.Collections.Generic;

using ponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;

using WMPLib;

using System.Media;

using System.Threading;

namespace WindowsFormsApp1

{

public partial class GaryV : Form

{

Thread th;

private SoundPlayer player;

public GaryV()

{

this.FormBorderStyle = FormBorderStyle.FixedSingle;

InitializeComponent();

player = new SoundPlayer("fundal.wav");

player.PlayLooping();

}

private void GaryV_Load(object sender, EventArgs e)

{

label1.Parent = pictureBox1;

label1.BackColor = Color.Transparent;

player.Play();

}

private void pictureBox1_Click(object sender, EventArgs e)

{

}

private void button1_Click(object sender, EventArgs e)

{

System.Diagnostics.Process.Start("");

}

private void button2_Click(object sender, EventArgs e)

{

}

private void checkBox1_CheckedChanged(object sender, EventArgs e)

{

if(checkBox1.Checked)

{

checkBox1.Text = "Sound: OFF";

player.Stop();

}

else

{

checkBox1.Text = "Sound: ON";

player.PlayLooping();

}

}

private void label1_Click(object sender, EventArgs e)

{

}

private void button2_Click_1(object sender, EventArgs e)

{

this.Close();

th = new Thread(usu1);

th.SetApartmentState(ApartmentState.STA);

th.Start();

}

private void pictureBox1_Click_1(object sender, EventArgs e)

{

}

private void button3_Click(object sender, EventArgs e)

{

this.Close();

th = new Thread(usu2);

th.SetApartmentState(ApartmentState.STA);

th.Start();

}

private void button4_Click(object sender, EventArgs e)

{

this.Close();

th = new Thread(usu3);

th.SetApartmentState(ApartmentState.STA);

th.Start();

}

private void usu1(object obj)

{

Application.Run(new Story());

}

private void usu2(object obj)

{

Application.Run(new Form9());

}

private void usu3(object obj)

{

Application.Run(new salvation());

}

private void usu4(object obj)

{

Application.Run(new comm());

}

private void button6_Click(object sender, EventArgs e)

{

this.Close();

th = new Thread(usu4);

th.SetApartmentState(ApartmentState.STA);

th.Start();

}

private void button5_Click(object sender, EventArgs e)

{

this.Close();

th = new Thread(usu5);

th.SetApartmentState(ApartmentState.STA);

th.Start();

}

private void usu5(object obj)

{

Application.Run(new game2());

}

}

}

Pentru paginile de Story:

using System;

using System.Collections.Generic;

using ponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;

using System.Threading;

namespace WindowsFormsApp1

{

public partial class Story : Form

{

Thread th;

public Story()

{

InitializeComponent();

}

private void Form3_Load(object sender, EventArgs e)

{

}

private void button1_Click(object sender, EventArgs e)

{

this.Close();

th = new Thread(usu1);

th.SetApartmentState(ApartmentState.STA);

th.Start();

}

private void button2_Click(object sender, EventArgs e)

{

this.Close();

th = new Thread(usu2);

th.SetApartmentState(ApartmentState.STA);

th.Start();

}

private void usu1(object obj)

{

Application.Run(new GaryV());

}

private void usu2(object obj)

{

Application.Run(new Story2());

}

private void pictureBox1_Click(object sender, EventArgs e)

{

}

}

}

using System;

using System.Collections.Generic;

using ponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;

using System.Threading;

namespace WindowsFormsApp1

{

public partial class Story2 : Form

{

Thread th;

public Story2()

{

InitializeComponent();

}

private void Story2_Load(object sender, EventArgs e)

{

}

private void button1_Click(object sender, EventArgs e)

{

this.Close();

th = new Thread(usu1);

th.SetApartmentState(ApartmentState.STA);

th.Start();

}

private void button2_Click(object sender, EventArgs e)

{

this.Close();

th = new Thread(usu2);

th.SetApartmentState(ApartmentState.STA);

th.Start();

}

private void usu1(object obj)

{

Application.Run(new Story());

}

private void usu2(object obj)

{

Application.Run(new Story3());

}

private void pictureBox1_Click(object sender, EventArgs e)

{

}

}

}

using System;

using System.Collections.Generic;

using ponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;

using System.Threading;

namespace WindowsFormsApp1

{

public partial class Story3 : Form

{

Thread th;

public Story3()

{

InitializeComponent();

}

private void Story3_Load(object sender, EventArgs e)

{

}

private void button1_Click(object sender, EventArgs e)

{

this.Close();

th = new Thread(usu1);

th.SetApartmentState(ApartmentState.STA);

th.Start();

}

private void button2_Click(object sender, EventArgs e)

{

this.Close();

th = new Thread(usu2);

th.SetApartmentState(ApartmentState.STA);

th.Start();

}

private void usu1(object obj)

{

Application.Run(new Story2());

}

private void usu2(object obj)

{

Application.Run(new Story4());

}

private void pictureBox1_Click(object sender, EventArgs e)

{

}

}

}

using System;

using System.Collections.Generic;

using ponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;

using System.Threading;

namespace WindowsFormsApp1

{

public partial class Story4 : Form

{

Thread th;

public Story4()

{

InitializeComponent();

}

private void button1_Click(object sender, EventArgs e)

{

this.Close();

th = new Thread(usu1);

th.SetApartmentState(ApartmentState.STA);

th.Start();

}

private void button2_Click(object sender, EventArgs e)

{

this.Close();

th = new Thread(usu2);

th.SetApartmentState(ApartmentState.STA);

th.Start();

}

private void usu1(object obj)

{

Application.Run(new Story3());

}

private void usu2(object obj)

{

Application.Run(new Story5());

}

private void Story4_Load(object sender, EventArgs e)

{

}

private void pictureBox1_Click(object sender, EventArgs e)

{

}

}

}

using System;

using System.Collections.Generic;

using ponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;

using System.Threading;

namespace WindowsFormsApp1

{

public partial class Story5 : Form

{

Thread th;

public Story5()

{

InitializeComponent();

}

private void button1_Click(object sender, EventArgs e)

{

this.Close();

th = new Thread(usu1);

th.SetApartmentState(ApartmentState.STA);

th.Start();

}

private void button2_Click(object sender, EventArgs e)

{

this.Close();

th = new Thread(usu2);

th.SetApartmentState(ApartmentState.STA);

th.Start();

}

private void usu1(object obj)

{

Application.Run(new Story4());

}

private void usu2(object obj)

{

Application.Run(new GaryV());

}

private void Story5_Load(object sender, EventArgs e)

{

}

private void pictureBox1_Click(object sender, EventArgs e)

{

}

}

}

Pentru Rules:

using System;

using System.Collections.Generic;

using ponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;

using System.Threading;

namespace WindowsFormsApp1

{

public partial class Form9 : Form

{

Thread th;

public Form9()

{

InitializeComponent();

}

private void button1_Click(object sender, EventArgs e)

{

this.Close();

th = new Thread(usu);

th.SetApartmentState(ApartmentState.STA);

th.Start();

}

private void usu(object obj)

{

Application.Run(new GaryV());

}

private void label1_Click(object sender, EventArgs e)

{

}

private void label2_Click(object sender, EventArgs e)

{

}

private void Form9_Load(object sender, EventArgs e)

{

}

}

}

Bara de loading:

using System;

using System.Collections.Generic;

using ponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;

using System.Threading;

namespace WindowsFormsApp1

{

public partial class bara : Form

{

Thread th;

public bara()

{

InitializeComponent();

timer1.Start();

button1.Enabled = false;

if(progressBar1.Value == 100)

{

label1.Text = "0%";

progressBar1.Value = 0;

}

}

private void timer1_Tick(object sender, EventArgs e)

{

progressBar1.Increment(1);

if(progressBar1.Value == 100)

{

label1.Text = "100%";

button1.Enabled = true;

timer1.Stop();

}

else

{

button1.Enabled = false;

label1.Text = progressBar1.Value + "%";

}

}

private void usu(object obj)

{

Application.Run(new gata());

}

private void button1_Click(object sender, EventArgs e)

{

this.Close();

th = new Thread(usu);

th.SetApartmentState(ApartmentState.STA);

th.Start();

}

private void bara_Load(object sender, EventArgs e)

{

}

}

}

Secțiunea despre:

using System;

using System.Collections.Generic;

using ponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;

using System.Threading;

namespace WindowsFormsApp1

{

public partial class comm : Form

{

Thread th;

public comm()

{

InitializeComponent();

}

private void button1_Click(object sender, EventArgs e)

{

this.Close();

th = new Thread(usu);

th.SetApartmentState(ApartmentState.STA);

th.Start();

}

private void usu(object obj)

{

Application.Run(new GaryV());

}

private void label1_Click(object sender, EventArgs e)

{

}

private void button2_Click(object sender, EventArgs e)

{

System.Diagnostics.Process.Start("");

}

private void comm_Load(object sender, EventArgs e)

{

}

}

}

Meniu Salvation:

using System;

using System.Collections.Generic;

using ponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;

using System.Threading;

using System.Media;

namespace WindowsFormsApp1

{

public partial class salvation : Form

{

Thread th;

private SoundPlayer player2;

public salvation()

{

this.FormBorderStyle = FormBorderStyle.FixedSingle;

InitializeComponent();

player2 = new SoundPlayer("metin1.wav");

player2.PlayLooping();

}

private void salvation_Load(object sender, EventArgs e)

{

}

private void button1_Click(object sender, EventArgs e)

{

this.Close();

th = new Thread(usu);

th.SetApartmentState(ApartmentState.STA);

th.Start();

}

private void usu(object obj)

{

Application.Run(new GaryV());

}

private void usu1(object obj)

{

Application.Run(new flappy());

}

private void usu2(object obj)

{

Application.Run(new flappy7());

}

private void usu3(object obj)

{

Application.Run(new flappy8());

}

private void button2_Click(object sender, EventArgs e)

{

this.Close();

th = new Thread(usu1);

th.SetApartmentState(ApartmentState.STA);

th.Start();

}

private void button3_Click(object sender, EventArgs e)

{

this.Close();

th = new Thread(usu2);

th.SetApartmentState(ApartmentState.STA);

th.Start();

}

private void button4_Click(object sender, EventArgs e)

{

this.Close();

th = new Thread(usu3);

th.SetApartmentState(ApartmentState.STA);

th.Start();

}

private void bindingSource1_CurrentChanged(object sender, EventArgs e)

{

}

private void checkBox1_CheckedChanged(object sender, EventArgs e)

{

if (checkBox1.Checked)

{

checkBox1.Text = "Sound: OFF";

player2.Stop();

}

else

{

checkBox1.Text = "Sound: ON";

player2.PlayLooping();

}

}

}

}

Easy level:

using System;

using System.Collections.Generic;

using ponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;

using System.IO;

using System.Media;

using WindowsFormsApp1.Properties;

using System.Threading;

namespace WindowsFormsApp1

{

public partial class flappy : Form

{

Thread th;

public flappy()

{

InitializeComponent();

}

List Pipe1 = new List();

List Pipe2 = new List();

int PipeWidth = 55;

int PipeDifferentY = 280;

int PipeDifferentX = 180;

bool start = true;

bool running;

int step = 3;

int OriginalX, OriginalY;

bool ResetPipes = false;

int points;

bool inPipe = false;

int score;

int ScoreDifferent;

private void Die()

{

running = false;

timer2.Enabled = false;

timer3.Enabled = false;

button1.Visible = true;

button1.Enabled = true;

button2.Visible = true;

button2.Enabled = true;

ReadAndShowScore();

points = 0;

pictureBox1.Location = new Point(OriginalX, OriginalY);

ResetPipes = true;

Pipe1.Clear();

}

private void ReadAndShowScore()

{

using (StreamReader reader = new StreamReader("Score.ini"))

{

score = int.Parse(reader.ReadToEnd());

reader.Close();

if ( int.Parse(label1.Text) == 0 | int.Parse(label1.Text) > 0)

{

ScoreDifferent = score - int.Parse(label1.Text) + 1;

}

if(score < int.Parse(label1.Text))

{

MessageBox.Show(string.Format("Congrats! Old best score {0}. New best score {1}", score, label1.Text), "Usurelu", MessageBoxButtons.OK, rmation);

using (StreamWriter writer = new StreamWriter("Score.ini"))

{

writer.Write(label1.Text);

writer.Close();

}

}

if(score > int.Parse(label1.Text))

{

MessageBox.Show(string.Format("Another {0} points to beat the best score {1}", score - points, score), "Usurelu", MessageBoxButtons.OK, rmation);

}

if(score == int.Parse(label1.Text))

{

MessageBox.Show(string.Format("Your score {0} is equal with the best one",score), "Usurelu", MessageBoxButtons.OK, rmation);

}

}

}

private void StartGame()

{

ResetPipes = false;

timer1.Enabled = true;

timer2.Enabled = true;

timer3.Enabled = true;

Random random = new Random();

int num = random.Next(40, this.Height - this.PipeDifferentY);

int num1 = num + this.PipeDifferentY;

Pipe1.Clear();

Pipe1.Add(this.Width);

Pipe1.Add(num);

Pipe1.Add(this.Width);

Pipe1.Add(num1);

num = random.Next(40, (this.Height - PipeDifferentY));

num1 = num + this.PipeDifferentY;

Pipe2.Clear();

Pipe2.Add(this.Width + PipeDifferentX);

Pipe2.Add(num);

Pipe2.Add(this.Width + PipeDifferentX);

Pipe2.Add(num1);

button1.Visible = false;

button1.Enabled = false;

button2.Visible = false;

button2.Enabled = false;

running = true;

Focus();

}

private void timer1_Tick(object sender, EventArgs e)

{

this.Invalidate();

}

private void button1_Click(object sender, EventArgs e)

{

StartGame();

}

private void timer2_Tick(object sender, EventArgs e)

{

if (Pipe1[0] + PipeWidth 0)

{

ScoreDifferent = score - int.Parse(label1.Text) + 1;

}

if(score < int.Parse(label1.Text))

{

MessageBox.Show(string.Format("Congrats! Old best score {0}. New best score {1}", score, label1.Text), "Noroc", MessageBoxButtons.OK, rmation);

using (StreamWriter writer = new StreamWriter("Score2.ini"))

{

writer.Write(label1.Text);

writer.Close();

}

}

if(score > int.Parse(label1.Text))

{

MessageBox.Show(string.Format("Another {0} points to beat the best score {1}", score - points, score), "Noroc", MessageBoxButtons.OK, rmation);

}

if(score == int.Parse(label1.Text))

{

MessageBox.Show(string.Format("Your score {0} is equal with the best one",score), "Noroc", MessageBoxButtons.OK, rmation);

}

}

}

private void StartGame()

{

ResetPipes = false;

timer1.Enabled = true;

timer2.Enabled = true;

timer3.Enabled = true;

Random random = new Random();

int num = random.Next(40, this.Height - this.PipeDifferentY);

int num1 = num + this.PipeDifferentY;

Pipe1.Clear();

Pipe1.Add(this.Width);

Pipe1.Add(num);

Pipe1.Add(this.Width);

Pipe1.Add(num1);

num = random.Next(40, (this.Height - PipeDifferentY));

num1 = num + this.PipeDifferentY;

Pipe2.Clear();

Pipe2.Add(this.Width + PipeDifferentX);

Pipe2.Add(num);

Pipe2.Add(this.Width + PipeDifferentX);

Pipe2.Add(num1);

button1.Visible = false;

button1.Enabled = false;

button2.Visible = false;

button2.Enabled = false;

running = true;

Focus();

}

private void timer1_Tick(object sender, EventArgs e)

{

this.Invalidate();

}

private void button1_Click(object sender, EventArgs e)

{

StartGame();

}

private void timer2_Tick(object sender, EventArgs e)

{

if (Pipe1[0] + PipeWidth 0)

{

ScoreDifferent = score - int.Parse(label1.Text) + 1;

}

if(score < int.Parse(label1.Text))

{

MessageBox.Show(string.Format("Congrats! Old best score {0}. New best score {1}", score, label1.Text), "Stochitoiu", MessageBoxButtons.OK, rmation);

using (StreamWriter writer = new StreamWriter("Score3.ini"))

{

writer.Write(label1.Text);

writer.Close();

}

}

if(score > int.Parse(label1.Text))

{

MessageBox.Show(string.Format("Another {0} points to beat the best score {1}", score - points, score), "Stochitoiu", MessageBoxButtons.OK, rmation);

}

if(score == int.Parse(label1.Text))

{

MessageBox.Show(string.Format("Your score {0} is equal with the best one",score), "Stochitoiu", MessageBoxButtons.OK, rmation);

}

}

}

private void StartGame()

{

ResetPipes = false;

timer1.Enabled = true;

timer2.Enabled = true;

timer3.Enabled = true;

Random random = new Random();

int num = random.Next(40, this.Height - this.PipeDifferentY);

int num1 = num + this.PipeDifferentY;

Pipe1.Clear();

Pipe1.Add(this.Width);

Pipe1.Add(num);

Pipe1.Add(this.Width);

Pipe1.Add(num1);

num = random.Next(40, (this.Height - PipeDifferentY));

num1 = num + this.PipeDifferentY;

Pipe2.Clear();

Pipe2.Add(this.Width + PipeDifferentX);

Pipe2.Add(num);

Pipe2.Add(this.Width + PipeDifferentX);

Pipe2.Add(num1);

button1.Visible = false;

button1.Enabled = false;

button2.Visible = false;

button2.Enabled = false;

running = true;

Focus();

}

private void timer1_Tick(object sender, EventArgs e)

{

this.Invalidate();

}

private void button1_Click(object sender, EventArgs e)

{

StartGame();

}

private void timer2_Tick(object sender, EventArgs e)

{

if (Pipe1[0] + PipeWidth ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download