سورس بازی پینگ پنگ در #C
در این قسمت سورس کد بازی پینگ پنگ Ping Pong را که با زبان سی شارپ در محیط Microsoft Visual Studio 2013 نوشته شده است را آماده کرده ایم. بازی پینگ پنگ به صورت دو نفری پیاده سازی شده است که هر بازی کن باید توپ در حال حرکت را بزند تا اجازه برخورد آن را به دیوار را ندهد، اگر برخورد اتفاق بیافتد به امتیاز بازیکن مقابل یک واحد اضافه خواهد شد.
تصویر خروجی سورس بازی پینگ پنگ در #C
قسمت هایی از سورس کد بازی پینگ پنگ
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | using RotatePictureBox; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using Pingpong.Properties; namespace Pingpong { public partial class Form1 : Form { public Form1() { InitializeComponent(); this.KeyPreview = true; } PictureBox[] Score_Player = new PictureBox[5]; //Array to hold the score pictureboxes PictureBox[] Score_Enemy = new PictureBox[5]; Color ScoreColor = Color.Silver; //Just to set the background color of the scoreboxes Random rng = new Random(); //If you change this, change it from the design page too Boolean Player_Up, Player_Down = false; //Booleans to see if player is going up or down Boolean BallGoingLeft = true; //Is the ball going left or right? Boolean GameOn = false; //Is the game on or paused int Speed_Player; //Dont change these, change them from the settings page int Speed_Enemy; int BallSpeed; int BallForce; int Round = 0; public Boolean Collision_Left(PictureBox obj) { if (obj.Location.X <= 0) //If the "obj" picturebox is behind the screen { return true; } return false; } public Boolean Collision_Right(PictureBox obj) { if (obj.Location.X + obj.Width >= WorldFrame.Width) //If the obj is further away the screen { return true; } return false; } |
ویدئوی معرفی محصول
درباره محصول
سورس بازی پینگ پنگ در #C با استفاده Microsoft Visual Studio 2013 نوشته شده است و بصورت کامل توسط گروه پشتیبانی پی استور تست و اجرا شده است. این برنامه مناسب برای دانشجویان و علاقه مندان به برنامه نویسی و طراحی گیم می باشد چرا که دارای کد های روان و قابل فهم و آسان برای یادگیری می باشد. خرید محصول توسط کلیه کارت های شتاب امکان پذیر است و بلافاصله پس از خرید، لینک دانلود محصول در اختیار شما قرار خواهد گرفت. کیفیت محصول توسط کارشناسان پی استور تضمین می شود.
programstore –
نظرات و پیشنهادات خود را با ما در میان بگذارید.