From 45b724bb1ea2e7c265a5f76cfcee250a81ab9bdd Mon Sep 17 00:00:00 2001 From: HalloSpaceBoy <111699451+HalloSpaceBoy5@users.noreply.github.com> Date: Fri, 15 Dec 2023 18:36:22 -0500 Subject: [PATCH] Update V3.2 --- Games/Breakout/Breakout.py | 2 +- Games/Flappy Bird/Flappy Bird.py | 3 +- Games/Game Of Life/Game Of Life.py | 2 +- Games/Pac Man/Pac Man.py | 2 +- .../Space Invaders (Title Image).pbimg | Bin 0 -> 115200 bytes .../Space Invaders/Space Invaders Title.pbimg | Bin 0 -> 115200 bytes Games/Space Invaders/Space Invaders.py | 494 ++++++++++++++++++ Games/Space Invaders/death.sprt | Bin 0 -> 512 bytes Games/Space Invaders/green_cornerL.sprt | Bin 0 -> 512 bytes Games/Space Invaders/green_cornerR.sprt | Bin 0 -> 512 bytes Games/Space Invaders/invader.sprt | Bin 0 -> 512 bytes Games/Space Invaders/player.sprt | Bin 0 -> 512 bytes Games/Starship/Starship.py | 2 +- Games/Tetris/Tetris.py | 2 +- PicoBoySDK.py | 9 +- st7789.py | 7 +- 16 files changed, 511 insertions(+), 12 deletions(-) create mode 100644 Games/Space Invaders/Space Invaders (Title Image).pbimg create mode 100644 Games/Space Invaders/Space Invaders Title.pbimg create mode 100644 Games/Space Invaders/Space Invaders.py create mode 100644 Games/Space Invaders/death.sprt create mode 100644 Games/Space Invaders/green_cornerL.sprt create mode 100644 Games/Space Invaders/green_cornerR.sprt create mode 100644 Games/Space Invaders/invader.sprt create mode 100644 Games/Space Invaders/player.sprt diff --git a/Games/Breakout/Breakout.py b/Games/Breakout/Breakout.py index dfde0dd..4a23175 100644 --- a/Games/Breakout/Breakout.py +++ b/Games/Breakout/Breakout.py @@ -106,7 +106,7 @@ def title_screen(): if ticks_diff(ticks_ms(), now) > 200: now = ticks_ms() - pgb.create_text("PRESS ANY BUTTON",-1,175,PicoGameBoy.color(255,255,255)) + pgb.create_text("PRESS A TO PLAY",-1,175,PicoGameBoy.color(255,255,255)) pgb.show() while ticks_diff(ticks_ms(), now) < 200: sleep(0.020) diff --git a/Games/Flappy Bird/Flappy Bird.py b/Games/Flappy Bird/Flappy Bird.py index 84f624b..5118b1a 100644 --- a/Games/Flappy Bird/Flappy Bird.py +++ b/Games/Flappy Bird/Flappy Bird.py @@ -204,8 +204,7 @@ def main_game(): break if ticks_diff(ticks_ms(), now) > 200: now = ticks_ms() - pgb.create_text("PRESS ANY BUTTON",20, 120,PicoGameBoy.color(0,0,0)) - pgb.create_text("TO PLAY",50, 130, PicoGameBoy.color(0,0,0)) + pgb.create_text("PRESS A TO PLAY",20, 120,PicoGameBoy.color(0,0,0)) pgb.show() pgb.free_mem() while ticks_diff(ticks_ms(), now) < 200: diff --git a/Games/Game Of Life/Game Of Life.py b/Games/Game Of Life/Game Of Life.py index 0002185..84a87af 100644 --- a/Games/Game Of Life/Game Of Life.py +++ b/Games/Game Of Life/Game Of Life.py @@ -31,7 +31,7 @@ def title_screen(): if time.ticks_diff(time.ticks_ms(), now) > 200: now = time.ticks_ms() - pgb.create_text("PRESS ANY BUTTON",-1,150,WHITE) + pgb.create_text("PRESS A TO PLAY",-1,150,WHITE) pgb.show() while time.ticks_diff(time.ticks_ms(), now) < 200: time.sleep(0.020) diff --git a/Games/Pac Man/Pac Man.py b/Games/Pac Man/Pac Man.py index 8ef32f1..dd0d935 100644 --- a/Games/Pac Man/Pac Man.py +++ b/Games/Pac Man/Pac Man.py @@ -602,7 +602,7 @@ def view_scores(): if ticks_diff(ticks_ms(), now) > 200: now = ticks_ms() - pgb.create_text("PRESS ANY BUTTON",-1,150,WHITE) + pgb.create_text("PRESS A TO PLAY",-1,150,WHITE) pgb.show() while ticks_diff(ticks_ms(), now) < 200: sleep(0.020) diff --git a/Games/Space Invaders/Space Invaders (Title Image).pbimg b/Games/Space Invaders/Space Invaders (Title Image).pbimg new file mode 100644 index 0000000000000000000000000000000000000000..f7e50dff27a9a49188cd63f332ef2e4a83dde815 GIT binary patch literal 115200 zcmeI4OO7P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gP+W@u_x!cyx#cwd z*+*~mlq%61J?OT~V}EU&Nc1qHK7qcs&u{<9tq-+OA%v zp08%F7CL?Z*@sJy>AQX9yKi}vI%f6HqA|7G{xqic-F5BxbFO^??P}HQq}#Y(w_Uow zUGJ`I&!2T&=1^++Jlt;UqccXYa%uNvT{E|z&225eta&c$_^Y^pnQLFbcTD`AP-2I=S^KQrMyUyWxvsXK5{cPnYcaQgjZb@J( z7uRR6rR!3&ehaEs9y1R*r}PS!!tjWP_sV?jFP6_>Z!VrUd#&f_Ti#DU>aXc~cc3c- zA{XbFz4j;LU1+rWV)y9ktKX+vcvUV=j}-zC*g}BU&=y)~ApijgKmY;|fWTG)eA?Pd z3_S!O00DmO;U0hh1R#(_;P3a}@2pzX$tS>k^OWWJfS^J^V3Uw*&HoAVL#%{v{H znD4dk0p`nmuT9{n)8%{$;q`med~@nD-yF_VfdB*`009U<00Izz00bZa0SG_<0uX=z z1nx^9=hyr>-!t?u?~v%H65!tY)XC8|1Rwwb2tZ&T0{VY1+9xAf&P0Iuo@pBU_riSl zXPTdJ{EdwH=1*h)ip+O^rk|0K*Y9V{>D4Zo@2liKV;}SVj5)p9CG&li+-K}#zMnCt zSG#1s&&Z9xdpz5DhB)&*!xY}v!)(5vedoT9*(YV5&G(beL9Y;i00bZa0SG|gbpm{< zeVrXUApijgKmY;|fB*y_009U<00I!WCIS8p(lzI5rz+DekNwa1j-2~-b8XiWyC0Ejop?N5dnI4%wD&vBUFUn3zf5d1gQPwDT)w@;qCueA@XH&&E8npM2W+ z6*GCBtyVtm{EBB|p4m@6?fiJ1_1~_00MU*z&q$& wCe1k^009U<00I!W0|7qU-C@d{5dsi^00bZa0SG_<0uX=z1Rwwb2%L?;f84^K4gdfE literal 0 HcmV?d00001 diff --git a/Games/Space Invaders/Space Invaders.py b/Games/Space Invaders/Space Invaders.py new file mode 100644 index 0000000..292defc --- /dev/null +++ b/Games/Space Invaders/Space Invaders.py @@ -0,0 +1,494 @@ +try: + from PicoBoySDK import PicoBoySDK, PlayerObject + PicoBoy=PicoBoySDK("Space Invaders",0) + Player=PlayerObject(PicoBoy,112,224,16,16,PicoBoy.Load_Sprite("player.sprt",16,16),4) + test=Player.initx +except: + try: + del PicoBoy + del Player + except: + "none" + from os import chdir, rename + chdir("/") + try: + try: + from PicoBoySDK import PicoBoySDK + except: + rename("/main.py", "/Space Invaders/Space Invaders.py") + rename("/title.py", "/main.py") + except: + rename("/main.py", "/Space Invaders.py") + rename("/title.py", "/main.py") + from PicoGameBoy import PicoGameBoy + pgb=PicoGameBoy() + pgb.fill(PicoGameBoy.color(0,0,0)) + pgb.create_text("Your OS is not",-1,20,PicoGameBoy.color(255,255,255)) + pgb.create_text("up to date!",-1, 35,PicoGameBoy.color(255,255,255)) + pgb.create_text("This game requires",-1,120,PicoGameBoy.color(255,255,255)) + pgb.create_text("at least PBOS V2.2",-1, 135,PicoGameBoy.color(255,255,255)) + pgb.create_text("to play this game.",-1,150,PicoGameBoy.color(255,255,255)) + pgb.create_text("Press Home to quit.",-1,220,PicoGameBoy.color(255,255,255)) + while True: + if pgb.button_Home(): + homebootstop=open("/noboot", "w") + homebootstop.close() + pgb.fill(PicoGameBoy.color(0,0,0)) + pgb.show() + machine.reset() + break + pgb.show_screen() +from random import randint +import time +from gc import mem_free + + +Player.direction="X" +hit_taken=False +enemysprite=PicoBoy.Load_Sprite("invader.sprt",16,16) +deathsprite=PicoBoy.Load_Sprite("death.sprt",16,16) +greencornerL=PicoBoy.Load_Sprite("green_cornerL.sprt",16,16) +greencornerR=PicoBoy.Load_Sprite("green_cornerR.sprt",16,16) + +starpattern=[] +for i in range(50): + starpattern.append((randint(5,235),randint(22,235))) +class Bullet: + def __init__(self, initx, inity, speed, direction, typ): + self.x=initx + self.y=inity + self.speed=speed + self.typ=typ + self.direction=direction + + def update(self): + global Player + global bull + global hit_taken + global playerbullets + if self.x+16>Player.x and self.x-16240 or self.y<20: + if self.typ: + try: + playerbullets.remove(self) + except: + del self + else: + del self + return + if self.direction==0: + self.y+=self.speed + else: + self.y-=self.speed + if self.typ==False: + PicoBoy.Fill_Rect(self.x+7,self.y,2,8,(255,0,0)) + else: + PicoBoy.Fill_Rect(self.x+7,self.y,2,8,(255,255,255)) + + +class enemy: + def __init__(self, colum,row): + self.colum=colum + self.row=row + self.x=colum*16 + self.y=row*16 + self.position=0 + self.offsetx=48 + self.offsety=0 + self.counter=0 + self.skip=False + self.waitamnt=1 + self.active=True + self.ex=0 + self.dactive=True + self.phase=1 + self.phasecounter=0 + self.sound=False + self.speed=0 + + def update(self): + global PicoBoy + global enemysprite + global enemylist + global bull + global erasedindicies + global deathsprite + global all1false + global all2false + global lives + self.x=self.colum*16+4*self.colum+self.offsetx + self.y=self.row*16+8*self.row+self.offsety+32 + if self.active: + self.phasecounter+=1 + self.counter+=1 + if all1false: + self.ex=3 + elif all2false: + self.ex=1 + if (int(self.offsety/16))==9+self.ex: + lives=0 + return + if self.phasecounter%5==0 and self.sound: + self.phasecounter=0 + PicoBoy.Stop_Sound(4) + self.phase+=1 + if self.phase>4: + self.phase=1 + self.sound=False + + if int(self.counter)%self.speed==0: + if not self.sound: + if self.phase==1: + PicoBoy.Play_Sound(200,4) + if self.phase==2: + PicoBoy.Play_Sound(150,4) + if self.phase==3: + PicoBoy.Play_Sound(100,4) + if self.phase==4: + PicoBoy.Play_Sound(50,4) + self.phasecounter=0 + self.sound=True + if self.offsetx==80+right_count*16 and self.offsety%32==0: + self.offsety+=16 + self.skip=True + elif self.offsetx==0-left_count*16 and not self.offsety%32==0: + self.offsety+=16 + self.skip=True + if not self.skip: + if self.offsety%32==0: + self.offsetx+=16 + else: + self.offsetx-=16 + else: + self.skip=False + self.counter=0 + PicoBoy.Render_Sprite(enemysprite,self.x,self.y) + elif self.dactive: + self.counter+=1 + if self.counter%5==0: + self.dactive=False + PicoBoy.Render_Sprite(deathsprite,self.x,self.y) + + +class brick: + def __init__(self, x,y,block): + self.x=16+x*16+block*32+48*block + self.y=y*16+176 + self.posx=x + self.posy=y + self.active=True + self.block=block + + def update(self): + global PicoBoy + global greencornerL + global greencornerR + if self.active: + if self.posx==0 and self.posy==0: + PicoBoy.Render_Sprite(greencornerL,self.x,self.y) + elif self.posx==2 and self.posy==0: + PicoBoy.Render_Sprite(greencornerR,self.x,self.y) + elif self.posx==0 and self.posy==2: + PicoBoy.Render_Sprite(greencornerL,self.x,self.y) + elif self.posx==2 and self.posy==2: + PicoBoy.Render_Sprite(greencornerR,self.x,self.y) + else: + PicoBoy.Fill_Rect(self.x,self.y,16,16,(0,255,0)) + + +def main_game(): + global lives + global enemylist + global score + global level + global all1false + global all2false + global left_count + global right_count + playerbullets=[] + erasedindicies=[] + fired=False + e_speed=30 + f_cooldown=0 + fb_cooldown=0 + a_cooldown=0 + enemylist=[] + global blockers + blockers=[] + for i in range(3): + temp=[] + for f in range(2): + temp1=[] + for g in range(3): + temp1.append(brick(g,f,i)) + temp.append(temp1) + blockers.append(temp) + global hit_taken + global bull + hit_taken=False + alldead=False + for i in range(8): + temp=[] + for f in range(3): + temp.append(enemy(i,f)) + enemylist.append(temp) + while True: + PicoBoy.Stop_Sound(2) + PicoBoy.Fill_Screen((0,0,0)) + for i in starpattern: + PicoBoy.hline(i[0],i[1],1,PicoBoy.color(255,255,255)) + PicoBoy.Create_Text("Score: "+str(score),4,4,(255,255,255)) + PicoBoy.Create_Text("LV"+str(level),125,4,(255,255,255)) + PicoBoy.Create_Text("Lives: "+str(lives),165,4,(255,255,255)) + PicoBoy.hline(0,17,240,PicoBoy.color(255,255,255)) + Player.Update() + if PicoBoy.Button("A") and a_cooldown==0: + playerbullets.append(Bullet(Player.x, Player.y, 8, 1, True)) + f_cooldown=4 + a_cooldown=5 + if a_cooldown>0: + a_cooldown-=1 + if f_cooldown>0: + PicoBoy.Play_Sound(1000,1) + f_cooldown-=1 + else: + PicoBoy.Stop_Sound(1) + if fb_cooldown==6: + PicoBoy.Play_Sound(200,2) + fb_cooldown-=1 + elif fb_cooldown==4: + PicoBoy.Play_Sound(300,2) + fb_cooldown-=1 + elif fb_cooldown==2: + PicoBoy.Play_Sound(400,2) + fb_cooldown-=1 + elif fb_cooldown>0: + fb_cooldown-=1 + killableenemies=[] + killableenemiescoords=[] + ch=[] + for i in enemylist: + a=0 + for f in i: + if f.active: + a+=1 + ch.append(a) + t=0 + for i in ch: + t+=i + new_e=round(e_speed*(t/(24+(level-1)))) + if new_e<5: + new_e=5 + for x,i in enumerate(enemylist): + highest=0 + newy=0 + newx=0 + for f in i: + f.speed=new_e + if f.active==True and f.row>=highest: + highest=f.row + newy=f.y + newx=f.x + killableenemies.append((x,highest)) + killableenemiescoords.append((newx,newy)) + for bullet in playerbullets: + bullet.update() + if bullet.y<20: + playerbullets.remove(bullet) + for x,enem in enumerate(killableenemiescoords): + if bullet.x+16>enem[0] and bullet.x-16240: + good2fire=True + except: + good2fire=True + if good2fire: + firablecoords=[] + for x,i in enumerate(enemylist): + highest=0 + newy=0 + newx=0 + for f in i: + if f.active==True and f.row>=highest: + highest=f.row + newy=f.y + newx=f.x + if not newy==0: + firablecoords.append((newx,newy)) + choice=firablecoords[randint(0,len(firablecoords)-1)] + bull=Bullet(choice[0],choice[1]+16,4,0,False) + try: + bull.update() + except: + "object doesnt exist" + for block in blockers: + for row in block: + for obj in row: + obj.update() + if obj.active: + for bullet in playerbullets: + if bullet.x+16>obj.x and bullet.x-16obj.x and bull.x-16y3&2+NY a>_7iEZ~>htjd}>J30X3ond$wHJzEdukw3uz literal 0 HcmV?d00001 diff --git a/Games/Space Invaders/green_cornerL.sprt b/Games/Space Invaders/green_cornerL.sprt new file mode 100644 index 0000000000000000000000000000000000000000..9ce170de42ead042dc159ba6c80ca621c7e596fb GIT binary patch literal 512 lcmZQzfC2Ug*dRm}n+!w@B#&E`{Q-Vi!t(gc9+jg!1OO#r+${hA literal 0 HcmV?d00001 diff --git a/Games/Space Invaders/green_cornerR.sprt b/Games/Space Invaders/green_cornerR.sprt new file mode 100644 index 0000000000000000000000000000000000000000..91b80a1ed503003fdd5d979b8990350f760c0952 GIT binary patch literal 512 ocmZR7z>WnnzyUT{h!{i(Zh7_xAQkxJ*&k3UkKgoBS;8Rz05`zgEdT%j literal 0 HcmV?d00001 diff --git a/Games/Space Invaders/invader.sprt b/Games/Space Invaders/invader.sprt new file mode 100644 index 0000000000000000000000000000000000000000..3fa7a1fa509baf78f944ada275d996333a5aae4b GIT binary patch literal 512 zcmb79K@tEV2=f1*c5_%p&`WhlKroAl$UN6Nsw#$YD$bqF#O~&Q%Bh%1YF^PrVkXOZ i*Y}yudK=eY*`A{ccIURu_)07E;BVe92Iof9wE};%ZwCkf literal 0 HcmV?d00001 diff --git a/Games/Space Invaders/player.sprt b/Games/Space Invaders/player.sprt new file mode 100644 index 0000000000000000000000000000000000000000..1d901f970ecd08c0f8792fae1a481148b64c456e GIT binary patch literal 512 pcmZQzpeA5{!2STYc_3MQDh5^_W;-qy;*v)eM`trIpo 200: now = ticks_ms() - pgb.create_text("PRESS ANY BUTTON",-1,160,PicoGameBoy.color(255,255,255)) + pgb.create_text("PRESS A TO PLAY",-1,160,PicoGameBoy.color(255,255,255)) pgb.show() while ticks_diff(ticks_ms(), now) < 200: sleep(0.020) diff --git a/Games/Tetris/Tetris.py b/Games/Tetris/Tetris.py index de65846..c954d5e 100644 --- a/Games/Tetris/Tetris.py +++ b/Games/Tetris/Tetris.py @@ -275,7 +275,7 @@ def title_screen(): if time.ticks_diff(time.ticks_ms(), now) > 200: now = time.ticks_ms() - pgb.center_text("PRESS ANY BUTTON",WHITE) + pgb.center_text("PRESS A TO PLAY",WHITE) pgb.show() while time.ticks_diff(time.ticks_ms(), now) < 200: time.sleep(0.020) diff --git a/PicoBoySDK.py b/PicoBoySDK.py index 496ac27..1facafc 100644 --- a/PicoBoySDK.py +++ b/PicoBoySDK.py @@ -49,7 +49,10 @@ def __init__(self, width=240, height=240, id_=0, sck=18, mosi=19, self.dc = Pin(dc, Pin.OUT) self.rst = Pin(rst, Pin.OUT) self.cs = Pin(cs, Pin.OUT) - self.bl = PWM(Pin(bl, Pin.OUT)) + try: + self.bl = PWM(Pin(bl, Pin.OUT),freq=1000,duty_u16=10000) + except: + self.bl = PWM(Pin(bl, Pin.OUT)) self.PWM_FREQUENCY = 1000 self.DUTY_CYCLE_MIN = 10000 self.DUTY_CYCLE=45000 @@ -459,8 +462,8 @@ def __init__(self,parent,initx,inity,width,height,sprite,speed): if not "PicoBoySDK" in str(type(parent)): print("PicoBoySDK Error: The PicoBoySDK object is missing or invalid in "+str(self)) sys.exit() - self.Initx=initx - self.Inity=inity + self.initx=initx + self.inity=inity self.x=initx self.y=inity self.width=width diff --git a/st7789.py b/st7789.py index 8032f0b..baed2a0 100644 --- a/st7789.py +++ b/st7789.py @@ -45,11 +45,14 @@ def __init__(self, width=240, height=240, id_=0, sck=18, mosi=19, dc=20, rst=21, cs=17, bl=22, baudrate=62500000): self.width = width self.height = height - self.spi = SPI(id_, sck=Pin(sck), mosi=Pin(mosi), baudrate=baudrate, polarity=0, phase=0) self.dc = Pin(dc, Pin.OUT) self.rst = Pin(rst, Pin.OUT) self.cs = Pin(cs, Pin.OUT) - self.bl = PWM(Pin(bl, Pin.OUT)) + try: + self.bl = PWM(Pin(bl, Pin.OUT),freq=1000,duty_u16=10000) + except: + self.bl = PWM(Pin(bl, Pin.OUT)) + self.spi = SPI(id_, sck=Pin(sck), mosi=Pin(mosi), baudrate=baudrate, polarity=0, phase=0) self.PWM_FREQUENCY = 1000 self.DUTY_CYCLE_MIN = 10000 #Minimum Brightness self.DUTY_CYCLE=45000 #Brightness