Viikkokisa - Solaris
Re: Viikkokisa - Solaris
No juu tunnustan ottaneeni tuon törmäyksen sieltä, siis sen missä katsotaan osuuko ukkeli kattoon vai mahaan tai ei minnekkään.
Re: Viikkokisa - Solaris
No onko sillä nyt väliä jos esimerkeistä kopioi? Oisihan siitä kumminkin saanut ottaa _mallia_....
cbEnchanted, uudelleenkirjoitettu runtime. Uusin versio: 0.4.1 — Nyt myös sorsat GitHubissa!
NetMatch - se kunnon nettimättö-deathmatch! Avoimella lähdekoodilla varustettu
vesalaakso.com
NetMatch - se kunnon nettimättö-deathmatch! Avoimella lähdekoodilla varustettu
vesalaakso.com
Re: Viikkokisa - Solaris
Mavi toukka saa päättä kohtalon, niin tästä ei tarvitse kiistellä?OonSuomesta wrote:No onko sillä nyt väliä jos esimerkeistä kopioi? Oisihan siitä kumminkin saanut ottaa _mallia_....
EDIT:
Pieni paljastus: Pelini nimeksi tulee BOX
Koodarina kohtalainen, henkilönä vittumainen
Re: Viikkokisa - Solaris
Ei haittaa, voisihan saman koodin kirjoittaa mallista ja se ei ole silloin kopioimista kuten OonSuomesta sanoi.
Re: Viikkokisa - Solaris
Päätinpä osallistua tällä pikkupelillä.. Nuolista ohjaa, ylänuoli hyppää.
Code: Select all
Framelimit 40
Type WALLS
Field width
Field height
Field x
Field y
Field img
End Type
Const GRAVITY=0.05
sky=MakeImage(ScreenWidth(),ScreenHeight())
DrawToImage sky
For s=0 To 100
PutPixel Rand(0,ImageWidth(sky)),Rand(0,ImageHeight(sky)),255
Next s
DrawToScreen
player=MakeImage(20,20)
DrawToImage player
Color 0,255,0
Box 0,0,ImageWidth(player),ImageHeight(player),OFF
DrawToScreen
Global score
x#=ImageWidth(player)
y#=ScreenHeight()-ScreenHeight()/3-ImageHeight(player)
drop#=0
score=0
addwall=Timer()
scoreplus=Timer()
Repeat
DrawImage sky,0,0
If Timer()>scoreplus+1000 Then
score=score+1
scoreplus=Timer()
EndIf
If Timer()>addwall+1000 Then
wall.WALLS=New(WALLS)
wall\width=Rand(20,100)
wall\height=Rand(20,100)
wall\x=ScreenWidth()
wall\y=ScreenHeight()-ScreenHeight()/3-wall\height
wall\img=MakeImage(wall\width,wall\height)
DrawToImage wall\img
Color cbBlackSkin
Box 0,0,ImageWidth(wall\img),ImageHeight(wall\img),ON
Color 0,255,0
Box 0,0,ImageWidth(wall\img),ImageHeight(wall\img),OFF
DrawToScreen
addwall=Timer()
EndIf
For wall.WALLS = Each WALLS
DrawImage wall\img,wall\x,wall\y
wall\x=wall\x-5
If ImagesOverlap(player,x,y,wall\img,wall\x,wall\y) Then Goto failed
Next wall
Color cbBlackSkin
Box 0,ScreenHeight()-ScreenHeight()/3,ScreenWidth(),ScreenHeight()-ScreenHeight()/3
DrawImage player,x,y
x=x-LeftKey()*5+RightKey()*5
drop#=drop#-GRAVITY
y#=y#-drop
If y#>ScreenHeight()-ScreenHeight()/3-ImageHeight(player) Then
y#=ScreenHeight()-ScreenHeight()/3-ImageHeight(player): drop=0
EndIf
If UpKey() And y#>ScreenHeight()-ScreenHeight()/3-ImageHeight(player)-1 Then
drop=4
EndIf
If x<0 Then x=0
If x>ScreenWidth()-ImageWidth(player) Then x=ScreenWidth()-ImageWidth(player)
SetWindow "Your score: "+score
DrawScreen
Forever
failed:
txt$="Failed! Your score is "+score+" seconds."
Repeat
Color cbRed
Text ScreenWidth()/2-TextWidth(txt)/2,ScreenHeight()/2-TextHeight(txt)/2,txt
DrawScreen
Until EscapeKey()
EDIT:
Laitoin framelimitin.
Last edited by Character on Wed Jan 07, 2009 9:16 pm, edited 2 times in total.
Re: Viikkokisa - Solaris
Character, Laitappa tuohon peliin framelimit koska nopeilla koneilla peli pyörii mahdottoman nopeasti.
Valmiit pelit: House of Horrors , Battle Zone , Über Ball , Itdoti , Space Chaos , Bloxxplosives ☺
Projekti jota teen ehkä joskus vielä: viewtopic.php?f=11&t=2636 <-- Tämä rivi päivitetty 14.1.2013
Projekti jota teen ehkä joskus vielä: viewtopic.php?f=11&t=2636 <-- Tämä rivi päivitetty 14.1.2013
Re: Viikkokisa - Solaris
No siinä syy miksi tämä oli ihan mahdoton.
Re: Viikkokisa - Solaris
Pahoittelen etten ehtinyt (jaksanut) tehdä peliäni loppuun.
Koodarina kohtalainen, henkilönä vittumainen