自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(7)
  • 资源 (1)
  • 收藏
  • 关注

原创 2021-06-04

***********************************************PYTHON推箱子代码******************************************************上次我们写了贪吃蛇: https://blog.csdn.net/m0_58989917/article/details/117557272 这次我们写一下推箱子。 代码如下: import tkinter as tk import pyautogui as ag def Bo

2021-06-04 18:06:42 57

原创 &&&&&&PYTHON推箱子源代码&&&&&&

import tkinter as tk import pyautogui as ag def Box_Move(event): global x, y, w if event.keysym == "Up": if y - w > 0: tCanvas.move(box, 0, -w) tCanvas.move(box2, 0, -w) tCanvas.move(pol, 0, -w) ...

2021-06-04 18:09:13 107

原创 2021-06-04

PYTHON推箱子代码 上次我们写了贪吃蛇:https://blog.csdn.net/m0_58989917/article/details/117557272 这次我们写一下推箱子。 代码如下: import tkinter as tk import pyautogui as ag def Box_Move(event): global x, y, w if event.keysym == "Up": if y - w > 0: t

2021-06-04 17:17:06 50

原创 2021-06-04

python贪吃蛇代码 import turtle as t import random WIN_WIDTH = 500 # 窗口宽度 WIN_HEIGHT = 500 # 窗口高度 SPOT_WIDTH = 10 # 贪吃蛇的宽度(方格的宽度) isPause = False # 是否暂停 # 定义贪吃蛇类 class HungrySnake(object): """docstring for HungrySnake""" x_add = SPOT_WIDTH # 贪吃

2021-06-04 12:55:05 95

原创 2021-06-04

PYTHON俄罗斯方块代码 from tkinter import * import time import threading import random import math from tkinter import messagebox BIANCHANG = 19 COLOR = ['red', 'orange', 'yellow', 'green', 'blue', 'purple', '#00C5CD', '#00EE76', '#388E8E', '#556B2F', '#6B8E23',

2021-06-04 12:23:52 72

原创 2021-06-04

C++推箱子代码 上代码 #include<iostream> using namespace std; //地图数据 int map[10][10] = { {1,1,1,1,1,1,1,1,1,1}, {1,0,0,0,0,1,0,0,0,1}, {1,0,0,4,0,1,0,3,0,1}, {1,0,2,0,0,0,0,0,0,1}, {1,0,0,0,0,0,0,0,0,1}, {1,1,1,1,0,0,0,0,0,1}, {1,0,0,0,0,0,0,3,0,1},

2021-06-04 12:09:53 40 2

原创 2021-06-04

C++飞机大战源代码 话不多说,直接上代码 #include<iostream> #include<cstdlib> #include<conio.h> #include<windows.h> // gotoxy 和HideCursor的头文件 using namespace std; int sizex=50;//空间的宽 int sizey=40;//空间的高度; int plane_x=sizex/2;//飞机的位置x,y; int pla...

2021-06-04 11:58:50 122

有意思的VC++射击游戏附代码.zip

#include<iostream> #include<cstdlib> #include<conio.h> #include<windows.h> // gotoxy 和HideCursor的头文件 using namespace std; int sizex=50;//空间的宽 int sizey=40;//空间的高度; int plane_x=sizex/2;//飞机的位置x,y; int plane_y=sizey/2; int gunx=0,guny=0; int speed=0; int score=0; int dp_x=rand()%sizex,dp_y=0; //敌机位置 char ss;//输入按键; void notin(); void in(); void gotoxy(int x,int y) //清屏,屏幕不抖动 { HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE); COORD pos; pos.X=x; pos.Y =y; SetConsoleCursorPosition(handle,pos); } void HideCursor() //隐藏光标; { CONSOLE_CURSOR_INFO cursor_info={1,0};//第二个值为0 表示隐藏光标 SetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE),&cursor_info); } void show()//初始化显示 { gotoxy(0,0) ; HideCursor() ; for(int y=1;y<=sizey;++y) { for(int x=1;x<=sizex;++x) { if(x==plane_x&&y==plane_y) { cout<<"*" ; } else if(x==gunx&&y==guny) { cout<<"|"; } else if(x==dp_x&&y==dp_y) { cout<<"&" ; } else { cout<<" "; } } cout<<endl; } cout<<"得分:"<<score; } void in() {//和输入有关的 if(kbhit()) { ss=getch(); switch(ss) { case'w': if(plane_y>1)plane_y--;break; //控制方向同时设置边界 case's': if(plane_y<sizey)plane_y++;break; case'a': if(plane_x>1)plane_x--;break; case'd': if(plane_x<sizex)plane_x++;break; case' ': gunx=plane_x,guny=plane_y-1;break; } } } void notin() {//和输入无关的; if(guny!=0) { guny--; } if(speed<5) //把敌机来临的速度变成子弹飞行的1/5倍 speed++; if(speed==5) { if(dp_y<sizey) { dp_y++; speed=0; } if(dp_y==sizey) { dp_y=0; dp_x=rand()%sizex;//改变生成的敌机位 speed=0; } } if(gunx==dp_x&&guny==dp_y) { dp_y=0; guny=-1 ; dp_x=rand()%sizex; //当击中敌机 score++; } } int main() { while(1) { show(); notin(); in() ; } return 0; }

2021-06-04

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除