123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Data;
- using System.Windows.Documents;
- using System.Windows.Input;
- using System.Windows.Media;
- using System.Windows.Media.Imaging;
- using System.Windows.Navigation;
- using System.Windows.Shapes;
- namespace clicker
- {
- public partial class MainWindow : Window
- {
- long point = 80;
- static int click = 1;
- double sol_b1 = 100;
- double sol_b2 = 250;
- double sol_b3 = 500;
- double sol_b4 = 1000;
- public MainWindow()
- {
- InitializeComponent();
- }
- public void Update()
- {
- poi.Content = "Points: " + point;
- cli.Content = "PpS: " + click;
- b1.Content = sol_b1.ToString();
- b2.Content = sol_b2.ToString();
- b3.Content = sol_b3.ToString();
- b4.Content = sol_b4.ToString();
- }
- public void main_image_MouseDown(object sender, MouseButtonEventArgs e)
- {
- MouseDownd_Update(ref point, ref click);
- }
- public long MouseDownd_Update(ref long point, ref int click)
- {
- point += click;
- Update();
- return point;
- }
- private void b1_Click(object sender, RoutedEventArgs e)
- {
- B1_Click_Update(ref point, ref click);
- }
- public long B1_Click_Update(ref long point, ref int click)
- {
- if (point >= (sol_b1))
- {
- point -= Convert.ToInt64(Math.Round(sol_b1));
- click += 3;
- Update();
- return point + click;
- }
- return 0;
- }
- public void b2_Click(object sender, RoutedEventArgs e)
- {
- B2_Click_Update(ref point, ref click);
- }
- public long B2_Click_Update(ref long point, ref int click)
- {
- if (point >= (sol_b2))
- {
- point -= Convert.ToInt64(Math.Round(sol_b2));
- click += 5;
- Update();
- return point + click;
- }
- return 0;
- }
- public void b3_Click(object sender, RoutedEventArgs e)
- {
- B3_Click_Update(ref point, ref click);
- }
- public long B3_Click_Update(ref long point, ref int click)
- {
- if (point >= (sol_b3))
- {
- point -= Convert.ToInt64(Math.Round(sol_b3));
- click += 7;
- Update();
- return point + click;
- }
- return 0;
- }
- public void b4_Click(object sender, RoutedEventArgs e)
- {
- B4_Click_Update(ref point, ref click);
- }
- public long B4_Click_Update(ref long point, ref int click)
- {
- if (point >= (sol_b4))
- {
- point -= Convert.ToInt64(Math.Round(sol_b4));
- click += 12;
- Update();
- return point+ click;
- }
- return 0;
- }
- private void exit_MouseDown(object sender, MouseButtonEventArgs e)
- {
- Application.Current.Shutdown();
- }
- }
- }
|