猫史档案馆


DBsMario

DBsMario

Lv.1

我是谁不重要,重要的是管子在我这里

获赞:8收藏:1浏览:188作品收藏:0

签名:每日刷帖,做作品 我...萌新 喜欢:UT,PVZ,国际版MC 讨厌:迷你世界,抄袭的人 epic!sans:"bruh~" PS:无 QQ:1719974340 RD代码岛小分队成员

回复帖子评论
上一页8 页 / 共 14下一页

代码岛通缉令 中回复

你还捣乱呢!简介“反本尊”反个毛线啊!

2020-05-05T18:37:46 点赞:0

我想加入工作室 中回复

门槛到了哦~

2020-05-05T18:38:34 点赞:0

通过ID知道在BCM是不是大佬 中回复

8258077

2020-05-05T19:54:14 点赞:0

又是日常作喵玩MC的一天 中回复

下核弹mod再点燃100颗核弹尤其致命

2020-05-06T07:50:19 点赞:0

【恐怖音乐】一个恐怖至极的音乐,一夜之间数百网友听完竟... 中回复

该不该挖坟呢?

2020-05-06T07:53:32 点赞:0

【恐怖音乐】一个恐怖至极的音乐,一夜之间数百网友听完竟... 中回复

                              喵     
                          鸡你实在太美
                           鸡你是太美
                              喵
                         实在是太美鸡你
               鸡你 实在是太美鸡你  美
            鸡你  实在是太美鸡美   太美
        鸡你     实在是太美鸡美      太美        
    鸡你       实在是太美鸡美          太美
  鸡你       鸡你实在是美太美       美蓝球球
鸡 鸡       鸡你实在是太美          篮球篮球球
鸡            喵裆鸡太啊         蓝篮球
                喵裆裆鸡美
                  鸡你美裆    裆鸡美
                   鸡太美         鸡太美
                     鸡美              鸡美
                     鸡美                鸡美
                      鸡美                鸡美
                      鸡太                鸡太
                    金 猴                金猴
                    皮 鞋                皮鞋金猴
                     金光                金光 大道

2020-05-06T07:54:04 点赞:0

凑热闹来了嘿嘿 中回复

                              喵     
                          鸡你实在太美
                           鸡你是太美
                              喵
                         实在是太美鸡你
               鸡你 实在是太美鸡你  美
            鸡你  实在是太美鸡美   太美
        鸡你     实在是太美鸡美      太美        
    鸡你       实在是太美鸡美          太美
  鸡你       鸡你实在是美太美       美蓝球球
鸡 鸡       鸡你实在是太美          篮球篮球球
鸡            喵裆鸡太啊         蓝篮球
                喵裆裆鸡美
                  鸡你美裆    裆鸡美
                   鸡太美         鸡太美
                     鸡美              鸡美
                     鸡美                鸡美
                      鸡美                鸡美
                      鸡太                鸡太
                    金 猴                金猴
                    皮 鞋                皮鞋金猴
                     金光                金光 大道

2020-05-06T07:54:19 点赞:0

你们有多少金币 中回复

0(真的)

2020-05-06T08:06:42 点赞:0

我的作品没流量,打个广告抱歉! 中回复

我从来不打广告的(滑稽)

2020-05-06T08:09:40 点赞:0

python写一个打砖块 中回复

python贪吃蛇程序:

#!/usr/bin/python
# -*- coding: UTF-8 -*-

 
 
import random
import pygame
import sys
from pygame.locals import *
 
Snakespeed = 17
Window_Width = 800
Window_Height = 500
Cell_Size = 20  # Width and height of the cells
# Ensuring that the cells fit perfectly in the window. eg if cell size was
# 10     and window width or windowheight were 15 only 1.5 cells would
# fit.
assert Window_Width % Cell_Size == 0, "Window width must be a multiple of cell size."
# Ensuring that only whole integer number of cells fit perfectly in the window.
assert Window_Height % Cell_Size == 0, "Window height must be a multiple of cell size."
Cell_W = int(Window_Width / Cell_Size)  # Cell Width
Cell_H = int(Window_Height / Cell_Size)  # Cellc Height
 
 
White = (255, 255, 255)
Black = (0, 0, 0)
Red = (255, 0, 0)  # Defining element colors for the program.
Green = (0, 255, 0)
DARKGreen = (0, 155, 0)
DARKGRAY = (40, 40, 40)
YELLOW = (255, 255, 0)
Red_DARK = (150, 0, 0)
BLUE = (0, 0, 255)
BLUE_DARK = (0, 0, 150)
 
 
BGCOLOR = Black  # Background color
 
 
UP = 'up'
DOWN = 'down'      # Defining keyboard keys.
LEFT = 'left'
RIGHT = 'right'
 
HEAD = 0  # Syntactic sugar: index of the snake's head
 
 
def main():
    global SnakespeedCLOCK, DISPLAYSURF, BASICFONT
 
    pygame.init()
    SnakespeedCLOCK = pygame.time.Clock()
    DISPLAYSURF = pygame.display.set_mode((Window_Width, Window_Height))
    BASICFONT = pygame.font.Font('freesansbold.ttf', 18)
    pygame.display.set_caption('Snake')
 
    showStartScreen()
    while True:
        runGame()
        showGameOverScreen()
 
 
def runGame():
    # Set a random start point.
    startx = random.randint(5, Cell_W - 6)
    starty = random.randint(5, Cell_H - 6)
    wormCoords = [{'x': startx, 'y': starty},
                  {'x': startx - 1, 'y': starty},
                  {'x': startx - 2, 'y': starty}]
    direction = RIGHT
 
    # Start the apple in a random place.
    apple = getRandomLocation()
 
    while True:  # main game loop
        for event in pygame.event.get():  # event handling loop
            if event.type == QUIT:
                terminate()
            elif event.type == KEYDOWN:
                if (event.key == K_LEFT) and direction != RIGHT:
                    direction = LEFT
                elif (event.key == K_RIGHT) and direction != LEFT:
                    direction = RIGHT
                elif (event.key == K_UP) and direction != DOWN:
                    direction = UP
                elif (event.key == K_DOWN) and direction != UP:
                    direction = DOWN
                elif event.key == K_ESCAPE:
                    terminate()
 
        # check if the Snake has hit itself or the edge
        if wormCoords[HEAD]['x'] == -1 or wormCoords[HEAD]['x'] == Cell_W or wormCoords[HEAD]['y'] == -1 or wormCoords[HEAD]['y'] == Cell_H:
            return  # game over
        for wormBody in wormCoords[1:]:
            if wormBody['x'] == wormCoords[HEAD]['x'] and wormBody['y'] == wormCoords[HEAD]['y']:
                return  # game over
 
        # check if Snake has eaten an apply
        if wormCoords[HEAD]['x'] == apple['x'] and wormCoords[HEAD]['y'] == apple['y']:
            # don't remove worm's tail segment
            apple = getRandomLocation()  # set a new apple somewhere
        else:
            del wormCoords[-1]  # remove worm's tail segment
 
        # move the worm by adding a segment in the direction it is moving
        if direction == UP:
            newHead = {'x': wormCoords[HEAD]['x'],
                       'y': wormCoords[HEAD]['y'] - 1}
        elif direction == DOWN:
            newHead = {'x': wormCoords[HEAD]['x'],
                       'y': wormCoords[HEAD]['y'] + 1}
        elif direction == LEFT:
            newHead = {'x': wormCoords[HEAD][
                'x'] - 1, 'y': wormCoords[HEAD]['y']}
        elif direction == RIGHT:
            newHead = {'x': wormCoords[HEAD][
                'x'] + 1, 'y': wormCoords[HEAD]['y']}
        wormCoords.insert(0, newHead)
        DISPLAYSURF.fill(BGCOLOR)
        drawGrid()
        drawWorm(wormCoords)
        drawApple(apple)
        drawScore(len(wormCoords) - 3)
        pygame.display.update()
        SnakespeedCLOCK.tick(Snakespeed)
 
 
def drawPressKeyMsg():
    pressKeySurf = BASICFONT.render('Press a key to play.', True, White)
    pressKeyRect = pressKeySurf.get_rect()
    pressKeyRect.topleft = (Window_Width - 200, Window_Height - 30)
    DISPLAYSURF.blit(pressKeySurf, pressKeyRect)
 
 
def checkForKeyPress():
    if len(pygame.event.get(QUIT)) > 0:
        terminate()
    keyUpEvents = pygame.event.get(KEYUP)
    if len(keyUpEvents) == 0:
        return None
    if keyUpEvents[0].key == K_ESCAPE:
        terminate()
    return keyUpEvents[0].key
 
 
def showStartScreen():
    titleFont = pygame.font.Font('freesansbold.ttf', 100)
    titleSurf1 = titleFont.render('Snake!', True, White, DARKGreen)
    degrees1 = 0
    degrees2 = 0
    while True:
        DISPLAYSURF.fill(BGCOLOR)
        rotatedSurf1 = pygame.transform.rotate(titleSurf1, degrees1)
        rotatedRect1 = rotatedSurf1.get_rect()
        rotatedRect1.center = (Window_Width / 2, Window_Height / 2)
        DISPLAYSURF.blit(rotatedSurf1, rotatedRect1)
 
        drawPressKeyMsg()
 
        if checkForKeyPress():
            pygame.event.get()  # clear event queue
            return
        pygame.display.update()
        SnakespeedCLOCK.tick(Snakespeed)
        degrees1 += 3  # rotate by 3 degrees each frame
        degrees2 += 7  # rotate by 7 degrees each frame
 
 
def terminate():
    pygame.quit()
    sys.exit()
 
 
def getRandomLocation():
    return {'x': random.randint(0, Cell_W - 1), 'y': random.randint(0, Cell_H - 1)}
 
 
def showGameOverScreen():
    gameOverFont = pygame.font.Font('freesansbold.ttf', 100)
    gameSurf = gameOverFont.render('Game', True, White)
    overSurf = gameOverFont.render('Over', True, White)
    gameRect = gameSurf.get_rect()
    overRect = overSurf.get_rect()
    gameRect.midtop = (Window_Width / 2, 10)
    overRect.midtop = (Window_Width / 2, gameRect.height + 10 + 25)
 
    DISPLAYSURF.blit(gameSurf, gameRect)
    DISPLAYSURF.blit(overSurf, overRect)
    drawPressKeyMsg()
    pygame.display.update()
    pygame.time.wait(500)
    checkForKeyPress()  # clear out any key presses in the event queue
 
    while True:
        if checkForKeyPress():
            pygame.event.get()  # clear event queue
            return
 
 
def drawScore(score):
    scoreSurf = BASICFONT.render('Score: %s' % (score), True, White)
    scoreRect = scoreSurf.get_rect()
    scoreRect.topleft = (Window_Width - 120, 10)
    DISPLAYSURF.blit(scoreSurf, scoreRect)
 
 
def drawWorm(wormCoords):
    for coord in wormCoords:
        x = coord['x'] * Cell_Size
        y = coord['y'] * Cell_Size
        wormSegmentRect = pygame.Rect(x, y, Cell_Size, Cell_Size)
        pygame.draw.rect(DISPLAYSURF, DARKGreen, wormSegmentRect)
        wormInnerSegmentRect = pygame.Rect(
            x + 4, y + 4, Cell_Size - 8, Cell_Size - 8)
        pygame.draw.rect(DISPLAYSURF, Green, wormInnerSegmentRect)
 
 
def drawApple(coord):
    x = coord['x'] * Cell_Size
    y = coord['y'] * Cell_Size
    appleRect = pygame.Rect(x, y, Cell_Size, Cell_Size)
    pygame.draw.rect(DISPLAYSURF, Red, appleRect)
 
 
def drawGrid():
    for x in range(0, Window_Width, Cell_Size):  # draw vertical lines
        pygame.draw.line(DISPLAYSURF, DARKGRAY, (x, 0), (x, Window_Height))
    for y in range(0, Window_Height, Cell_Size):  # draw horizontal lines
        pygame.draw.line(DISPLAYSURF, DARKGRAY, (0, y), (Window_Width, y))
 
 
if __name__ == '__main__':
    try:
        main()
    except SystemExit:
        pass
start

2020-05-06T09:03:07 点赞:0

【编程猫考古】我发现了惊天大秘密!另一个编程猫子网站 中回复

加dev-也可以

2020-05-06T09:08:33 点赞:0

【教程贴】 中回复

好简单……

2020-05-06T09:16:30 点赞:0

全然不信sans 中回复

sans莫有全然不信除了带反转的AU

2020-05-06T11:12:36 点赞:1

全然不信sans 中回复

云玩家

2020-05-06T11:12:51 点赞:0

【羊爸!你为啥抢我家sans的审判词!?】 中回复

2020-05-06T11:14:13 点赞:0

【UT玩家福利】火柴人版sans来啦 中回复

。。。

2020-05-06T11:28:28 点赞:0

AU!各种sans! 中回复

原衫不喝番茄酱了!原衫不喝番茄酱了啊啊啊!

2020-05-06T11:29:39 点赞:0

全然不信sans 中回复

云玩家别乱说

2020-05-06T14:05:44 点赞:0

【编程小课堂】关于克隆体,你知多少? 中回复

第一个图好像sschara的滑稽脸

2020-05-06T14:41:06 点赞:0

【我想看看各个工作室的名字开头】 中回复

DBs

2020-05-06T15:57:51 点赞:0

【竞选社区管喵】月下樱花雨 中回复

噶油

2020-05-06T15:58:23 点赞:0

【讨论】嗯哼君可爱吗? 中回复

挖坟

2020-05-06T18:16:31 点赞:0

紧急通知:看内容,尤其是路人和4318008and蓝雀 中回复

反手挖坟(埋一把真刀进去)

2020-05-06T18:18:15 点赞:1

终于进1强了!!!!!!!!!!!!! 中回复

噶油奥利给!

2020-05-06T18:18:57 点赞:0

光明正大地抄袭,还和我参加同一个活动?【抄袭】【双喵之战】 中回复

帮我置顶谢谢:https://shequ.codemao.cn/community/290346

2020-05-06T19:04:18 点赞:0

【社区处罚公示】禁止一切MC与MN骂战行为 中回复

*chara觉得很赞

2020-05-07T16:19:31 点赞:0

让平板能也能创作 中回复

nemo是个好东西

2020-05-07T17:51:23 点赞:0

严重怀疑猫能星是女的 中回复

YDS猫能星star掘得很昝

2020-05-07T17:52:11 点赞:3

奥利给!我大号上潜力新作啦! 中回复

SO???

2020-05-07T17:59:31 点赞:0

我要进工作室!!!有人收吗,【我只想进二级或三级或四级工作室】!!! 中回复

门槛到了哦

2020-05-07T18:10:54 点赞:0