سورس بازی تانک به زبان ++C
در این پست برای شما کاربران گرامی سورس بازی تانک به زیان سی پلاس پلاس را آماده کرده ایم.
در این سورس بازی تانک، یک تانک به رنگ آبی در قسمت پایین صفحه به تانک های دشمن که از سمت بالا با رنگ قرمز به طرف پایین در حرکت است شلیک می کند و در صورت برخورد گلوله تانک مورد نظر منهدم می شودو اگر تانک های دشمن به پایین برسند و تانک آبی رو رد کنند یک امتیاز منفی به تانمک آبی داده خواهد شد.
این برنامه به زبان سی پلاس پلاس و با استفاده از کلاس و به صورت گرافیکی نوشته شده است که می توانید کدهای آن رو به صورت سلیقه ای تغییر بدهید.
جهت مشاهده جزئیات کامل سورس بازی تانک به زیان سی پلاس پلاس لطفا به ادامه مطلب مراجعه فرمائید.
تکه کد سورس بازی تانک به زبان ++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 54 55 56 57 58 59 60 61 62 63 64 65 | <span style="color: #ff0000;"><strong>جهت دریافت کد کامل این برنامه لطفا از بخش خرید محصول اقدام کنید</strong></span> #include <graphics.h> #include <iostream.h> #include <conio.h> #include <stdio.h> #include <stdlib.h> #include <bios.h> #include <dos.h> #include <string.h> //************************************* #define KEYB 98 // const code key B #define KEYN 110 // const code key N #define KEYESC 27 // const code key esc #define KEYRIGHT 77 // const code key arrow right #define KEYLEFT 75 // const code key arrow left #define KEYUP 72 // const code key arrow up #define KEYSPACE 32 // const code key space #define CLIP_ON 1 // const for type setviewport #define FIRENO 0 // const for tank plain no fire #define FIREOK 1 // const for tank plain fire ok #define DESTORYAIM 2 // const for tank plain destory object #define DIRECTUP 0 // const direction shoot up #define DIRECTDOWN 1 // const direction shoot down #define COLORPLAINUP WHITE // const color border plainup #define COLORPLAINUPBUDY RED // const color budy plainup #define COLORPLAINUPBALL GREEN // const color ball plainup #define COLORPLAINDOWN YELLOW // const color border plaindown #define COLORPLAINDOWNBUDY BLUE // const color budy plaindown #define COLORPLAINDOWNBALL MAGENTA // const color ball plaindown #define COLORSHOOTUP YELLOW // const color tir shoot to up #define COLORSHOOTDOWN RED // const color tir shoot to down #define COUNTTIR 10 // const count tir plaindown when fire #define BORDERWIDTH 20 // const border width screen #define DESTORYAIMOK 1 // const return 1 when plainup is destory #define DESTORYAIMNO 0 // const return 0 when plainup no destory #define VISIBLEOK 1 // const return 1 when plainup visible ok #define VISIBLENO 0 // const return 0 when plainup visible no #define PLAINUP 0 // const type tankplain up #define PLAINDOWN 1 // const type tankplain down #define COUNTPLAINUP 3 // const count plainup #define COUNTHEART 10 // const count heart plaindown #define RANGEINCHEART 1000 // const range amount when 1000 inc heart plaindown #define COUNTINCAMOUNT 100 // const count inc amount #define BUDYWIDTHUP 20 // const set width budy plainup #define BUDYWIDTHDOWN 20 // const set width budy plaindown //************************************* class borderscreen // declared class borderscreen for draw border { public: void show(); // function for draw all border void borderleft(); // function for border left void borderright(); // function for border right void borderdown(); // function for border down void borderup(); // function for border up void movetofront(); // function for move 3 rectangle in border screen }; //************************** void borderscreen::show() // function for call all functions for draw border screen { borderleft(); // call function for draw border left borderright(); // call function for draw border right borderdown(); // call function for draw border down borderup(); // call function for draw border up movetofront(); // call function for draw 3 rectangle in border screen } |





















(56 امتیاز از 15 رای)








هیچ نظری ثبت نشده است