Pikku-Pelit.

Muu yhteisön välinen keskustelu.
Post Reply
Mysterius Coder
Active Member
Posts: 133
Joined: Mon Aug 27, 2007 8:13 pm

Pikku-Pelit.

Post by Mysterius Coder »

Sarja vanhoja tuttuja topiikkeja jatkuu. Tämän tarpeellisuudesta on riidelty ja kiistelty mutta tässä se on taas. Kerrataan siis topiikin tarkoitus: tänne kerätään kaikkia pieniä räpellyksiä. kuitenkin pelejä jotka ovat ihan pelattavia ok?

Huomaa että jotkut pelit eivät vättämättä jonain päivänä lataudu, koska ne on eivät enää sijaitse palvelimella jonne tekijä on ne laittanut.

Topikista löytyvät pelit:
-AIRSOFT tehnyt arska. Kaksinpeli, kaksi asetta pistooli ja konekivääri.
-Niveaulos tekstiseikkailu, thehnyt spine chilling.
-Nimetön pientä räiskintää, tehnyt itkevä nakki.
-Balance vilskun tasapainottelu peli
-Kivi,sakset,paperi. weiltmeisterin pikku peli.
-Little green ball Alkun tasohyppely.
-Joon korispeli: (kopioi CB:hen)

Code: Select all

SAFEEXIT OFF
SCREEN 800,600,0,0
FrameLimit 60
Dim speedx As Float
Dim speedy As Float
Dim hx,hy As Float
korisnd=LoadSound("media\whip.wav")
tausta=MakeImage(800,600)
DrawToImage tausta
For y=1 To 600
Color y/3,y/4,50
Line 0,y,800,y
Next y
DrawToScreen
f=OpenToEdit("korisenkka.txt")
enkka=ReadInt(f)
CloseFile f

DrawImage tausta,0,0
Text 0,0,"Pelissä tarkoituksesi on heittää niin monta koria kuin ehdit minuutin aikana."
Text 0,20,"Anna pallolle vauhtia pitämällä pohjassa hiiren vasenta nappia heittoalueella,"
Text 0,40,"ja vapauta painike saadaksesi pallon liikkeelle."
DrawScreen
WaitKey
alku:
If start=1 Then
Text 0,0,"Heitit "+kori+" koria."
Text 0,20,"Ennätys on "+enkka+"."
Text 0,40,"Paina jotain näppäintä jatkaaksesi."
DrawScreen
WaitKey
EndIf
start=1
kori=0
ballX# = ScreenWidth() / 2
ballY# = ScreenHeight() / 2
velX# = 0
velY# = 0
PositionMouse ballX, ballY
x=400:y=300
painovoima#=.5
aika#=Timer()+60000

Repeat
vely=vely+painovoima
If bally>550 And vely>0 Then vely=-vely*.8
If ballx>780 And velx>0 Then velx=-velx*.8
If ballx<20 And velx<0 Then velx=-velx*.8
ballX = ballX + velX
ballY = ballY + velY
md=MouseDown(1)
If MouseX()>200 And md Then PositionMouse 200,MouseY()
If MouseY()<350 And md Then PositionMouse MouseX(),350
If MouseY()>550 And md Then PositionMouse MouseX(),550
If KeyHit(19) Then Goto alku
If Distance(705,205,ballx,bally)<20 Then
ang#=GetAngle(705,205,ballx,bally)
spe#=Sqrt(velx^2+vely^2)
If velx<>0 Then
spang#=Tan(vely/velx)
Else
If vely>0 Then spang=90 Else spang=270
EndIf
ero#=ang-spang
uus#=spang+2*ero
velx=Cos(uus)*spe*.8
vely=Sin(uus)*spe*.8
EndIf
If locked Then
hx=Max(-10,Min(MouseMoveX(),10))
hy=Max(-10,Min(MouseMoveY(),10))
speedx=speedx+hx/1.4
speedy=speedy+hy
ballx=MouseX()
bally=MouseY()
velx=0
vely=0
EndIf
speedx=.7*speedx
speedy=.7*speedy
If md Then locked=1
If MouseUp(1) Then
locked=0
korituli=0
velx=speedx
vely=speedy
lahella=0
EndIf
If ballx>715 And Abs(bally-205)<10 And vely>0 Then lahella=1
If korituli=1 Then lahella=0
If ballx>715 And Abs(bally-220)<10 And vely>0 And lahella Then kori=kori+1:PlaySound korisnd:korituli=1
jaljella#=(aika-Timer())/1000.0
If kori>enkka Then enkka=kori
If jaljella<0 Then Goto alku
// Lopuksi piirto
DrawImage tausta,0,0
Color 255,255,255
Text 0,0,"FPS: "+FPS()
Text 200,0,"KORIT: "+kori
Text 400,0,"ENKKA: "+enkka
Text 600,0,"AIKA: "+jaljella+"s"
Text 400,580,"Paina r aloittaaksesi uudelleen alusta."
Box MouseX()-1,MouseY()-1,3,3
Box 0,350,200,200,OFF
Text 20,530,"Heitä täältä"
Color 225,125,50
Circle ballX - 20, ballY - 20, 40, ON
Color 0,0,0
a=a-velx
a2=a+60
a3=a+120
Circle ballX - 20, ballY - 20, 40, OFF
Line ballx-Sin(a)*20,bally-Cos(a)*20,ballx+Sin(a)*20,bally+Cos(a)*20
Line ballx-Sin(a2)*20,bally-Cos(a2)*20,ballx+Sin(a2)*20,bally+Cos(a2)*20
Line ballx-Sin(a3)*20,bally-Cos(a3)*20,ballx+Sin(a3)*20,bally+Cos(a3)*20
Color 255,255,255
Box 700,200,10,10
Line 705,205,800,205
DrawScreen
Until EscapeKey()
f=OpenToEdit("korisenkka.txt")
WriteInt f,enkka
CloseFile f

-Wöm cb programmerin matopeli.
-Yo-Yo Tekstipeli tekijän jojo tekstipeli.
-Atzakan silmien rasitus peli, väistele palkkeja hiirellä.(kopioi CB:hen)

Code: Select all

SCREEN 400, 300
SAFEEXIT OFF

Const MEM_PER_WALL = 8

Main()

Function Main()

ClsColor 255, 255, 255
ShowMouse OFF

Dim bWalls As Byte
Dim fSpeed As Float
Dim iRound As integer
Dim iPoints As integer

bWalls = 3
fSpeed = 5.0
iRound = 1

memWalls = MakeMEMBlock( bWalls * MEM_PER_WALL )

x = 500
For i = 0 To bWalls - 1
h = Rand( 50, 150 )
PokeFloat memWalls, i * MEM_PER_WALL, x
PokeShort memWalls, 4 + i * MEM_PER_WALL, Rand( 50, 250 - h )
PokeByte memWalls, 6 + i * MEM_PER_WALL, Rand( 20, 30 )
PokeByte memWalls, 7 + i * MEM_PER_WALL, h
x + 200
Next i


Repeat

Cls

DrawBorders()
LimitMouse()
If ControlWalls( memWalls, bWalls, fSpeed ) = 1 Then
Cls
DrawScreen
Print "You got " + iPoints + " points!"
Wait 2000
Exit
EndIf

iPoints + 1

Color 0, 0, 0
Text 5, 5, "Points:" + iPoints

DrawScreen

iRound + 1
If iRound > 50 Then
fSpeed + 0.1
iRound = 0
EndIf

Until KeyHit( CbKeyEsc )

DeleteMEMBlock memWalls

End Function


Function DrawBorders()

Color 0, 200, 0
Box 0, 0, 640, 50
Box 0, 250, 640, 50

End Function


Function LimitMouse()

If MouseY() > 240 Then PositionMouse MouseX(), 240
If MouseY() < 60 Then PositionMouse MouseX(), 60

Color 150, 0, 0
Box MouseX() - 5, MouseY() - 5, 10, 10

End Function


Function ControlWalls( _memBlock, _wallsTot, _speed# )

For i = 0 To _wallsTot - 1
x = PeekFloat( _memBlock, i * MEM_PER_WALL )
y = PeekShort( _memBlock, 4 + i * MEM_PER_WALL )
w = PeekByte( _memBlock, 6 + i * MEM_PER_WALL )
h = PeekByte( _memBlock, 7 + i * MEM_PER_WALL )

Color 123, 90, 0
Box x, y, w, h

If CheckCollisions() = 1 Then Return 1

If x < -90 Then
h = Rand( 50, 150 )
PokeFloat _memBlock, i * MEM_PER_WALL, 500
PokeShort _memBlock, 4 + i * MEM_PER_WALL, Rand( 50, 250 - h )
PokeByte _memBlock, 6 + i * MEM_PER_WALL, Rand( 20, 30 )
PokeByte _memBlock, 7 + i * MEM_PER_WALL, h
Else
PokeFloat _memBlock, i * MEM_PER_WALL, x - _speed
EndIf

Next i

End Function


Function CheckCollisions()

PickColor MouseX() + 5, MouseY() + 5
If getRGB( GREEN ) > 85 And getRGB( GREEN ) < 95 Then Return 1

PickColor MouseX() + 5, MouseY() - 5
If getRGB( GREEN ) > 85 And getRGB( GREEN ) < 95 Then Return 1

PickColor MouseX() - 5, MouseY() + 5
If getRGB( GREEN ) > 85 And getRGB( GREEN ) < 95 Then Return 1

PickColor MouseX() - 5, MouseY() - 5
If getRGB( GREEN ) > 85 And getRGB( GREEN ) < 95 Then Return 1

End Function


-Hiirulaiset Vilskun minipeli, tiputa hiiret reikään.
-Oudon koodarin Fusion Game. Käytä hiirtä ja hiiren näppäimiä vapauttamaan energiaa. (kopioi CB:hen)

Code: Select all

SCREEN 800,600
Type ATOM
Field X As Float
Field Y As Float
Field Material As Integer
Field Energy As Float
Field SpeedX As Float
Field SpeedY As Float
Field ElectAngle As Float
EndType

Dim AtomImages(2) As Integer
Const AT_Hydrogen=1
Const AT_Hydrogen2=2
Const AT_Hydrogen3=3
Const AT_Neutron=4
Const AT_Helium=5
Const MAX_Senter_Dist=200.0
Const Friction=0.95
Const targ=12
Global Fusion_CenterX As Float
Global Fusion_CenterY As Float
Fusion_CenterX=ScreenWidth()/2
Fusion_CenterY=ScreenHeight()/2


Global SPickATOM
Global IsPicked
Global Presure

Global Fusion_LineX1 As Float
Global Fusion_LineY1 As Float
Global Fusion_LineX2 As Float
Global Fusion_LineY2 As Float
Global Fusion_Timer As Integer
Global Fusion_NSpeedX As Float
Global Fusion_NSpeedY As Float
Global Fusion_Energy As Integer

Function GenImageElectron()
img=MakeImage(10,10)
DrawToImage img
Color 0,0,0:Dot 0,0:Dot 1,0:Dot 2,0:Dot 3,0:Color 85,106,128:Dot 4,0:Color 83,103,125:Dot 5,0:Color 0,0,0:Dot 6,0:Dot 7,0:Dot 8,0:Dot 9,0
Dot 0,1:Dot 1,1:Color 89,109,132:Dot 2,1:Color 89,110,134:Dot 3,1:Dot 4,1:Color 89,110,135:Dot 5,1:Color 86,107,129:Dot 6,1:Color 71,91,110:Dot 7,1:Color 0,0,0:Dot 8,1:Dot 9,1
Dot 0,2:Color 89,109,132:Dot 1,2:Color 89,110,134:Dot 2,2:Dot 3,2:Dot 4,2:Dot 5,2:Dot 6,2:Color 80,100,121:Dot 7,2:Color 59,76,95:Dot 8,2:Color 0,0,0:Dot 9,2
Dot 0,3:Color 92,113,137:Dot 1,3:Color 89,110,134:Dot 2,3:Dot 3,3:Dot 4,3:Dot 5,3:Color 89,110,132:Dot 6,3:Color 79,100,121:Dot 7,3:Color 61,80,98:Dot 8,3:Color 0,0,0:Dot 9,3
Color 85,107,129:Dot 0,4:Color 89,110,134:Dot 1,4:Dot 2,4:Dot 3,4:Dot 4,4:Dot 5,4:Color 86,107,129:Dot 6,4:Color 76,95,116:Dot 7,4:Color 61,76,95:Dot 8,4:Color 40,55,70:Dot 9,4
Color 83,103,125:Dot 0,5:Color 92,113,137:Dot 1,5:Color 89,110,134:Dot 2,5:Dot 3,5:Dot 4,5:Color 89,109,132:Dot 5,5:Color 80,100,121:Dot 6,5:Color 70,88,107:Dot 7,5:Color 53,70,86:Dot 8,5:Color 37,52,67:Dot 9,5
Color 0,0,0:Dot 0,6:Color 86,107,129:Dot 1,6:Color 89,110,134:Dot 2,6:Color 89,109,132:Dot 3,6:Color 86,107,129:Dot 4,6:Color 80,100,121:Dot 5,6:Color 71,89,110:Dot 6,6:Color 61,77,95:Dot 7,6:Color 46,61,76:Dot 8,6:Color 0,0,0:Dot 9,6
Dot 0,7:Color 71,89,110:Dot 1,7:Color 80,100,122:Dot 2,7:Color 79,98,121:Dot 3,7:Color 76,95,116:Dot 4,7:Color 70,88,107:Dot 5,7:Color 61,77,95:Dot 6,7:Color 47,62,79:Dot 7,7:Color 37,50,65:Dot 8,7:Color 0,0,0:Dot 9,7
Dot 0,8:Dot 1,8:Color 58,74,92:Dot 2,8:Color 61,79,98:Dot 3,8:Color 61,77,95:Dot 4,8:Color 53,70,86:Dot 5,8:Color 46,61,76:Dot 6,8:Color 37,50,65:Dot 7,8:Color 0,0,0:Dot 8,8:Dot 9,8
Dot 0,9:Dot 1,9:Dot 2,9:Dot 3,9:Color 38,53,68:Dot 4,9:Color 37,52,67:Dot 5,9:Color 0,0,0:Dot 6,9:Dot 7,9:Dot 8,9:Dot 9,9
DrawToScreen
Return img
EndFunction

Function GenImageNeutron()
img=MakeImage(17,17)
DrawToImage img
Color 0,0,0:Dot 0,0:Dot 1,0:Dot 2,0:Dot 3,0:Dot 4,0:Dot 5,0:Dot 6,0:Color 0,220,0:Dot 7,0:Dot 8,0:Color 0,197,0:Dot 9,0:Color 0,0,0:Dot 10,0:Dot 11,0:Dot 12,0:Dot 13,0:Dot 14,0:Dot 15,0:Dot 16,0
Dot 0,1:Dot 1,1:Dot 2,1:Dot 3,1:Color 0,218,17:Dot 4,1:Color 0,247,0:Dot 5,1:Color 0,254,16:Dot 6,1:Dot 7,1:Color 0,253,13:Dot 8,1:Color 0,243,19:Dot 9,1:Color 0,228,12:Dot 10,1:Color 0,185,0:Dot 11,1:Color 0,133,8:Dot 12,1:Color 0,0,0:Dot 13,1:Dot 14,1:Dot 15,1:Dot 16,1
Dot 0,2:Dot 1,2:Dot 2,2:Color 6,233,0:Dot 3,2:Color 0,254,16:Dot 4,2:Dot 5,2:Dot 6,2:Color 0,244,21:Dot 7,2:Color 0,254,16:Dot 8,2:Dot 9,2:Color 0,252,8:Dot 10,2:Color 0,219,20:Dot 11,2:Color 9,191,12:Dot 12,2:Color 7,128,2:Dot 13,2:Color 0,0,0:Dot 14,2:Dot 15,2:Dot 16,2
Dot 0,3:Dot 1,3:Color 0,228,12:Dot 2,3:Color 0,254,16:Dot 3,3:Dot 4,3:Color 0,255,19:Dot 5,3:Dot 6,3:Dot 7,3:Color 0,254,16:Dot 8,3:Dot 9,3:Dot 10,3:Color 0,243,19:Dot 11,3:Color 0,209,0:Dot 12,3:Color 0,167,10:Dot 13,3:Color 0,105,1:Dot 14,3:Color 0,0,0:Dot 15,3:Dot 16,3
Dot 0,4:Color 0,219,20:Dot 1,4:Color 0,254,16:Dot 2,4:Dot 3,4:Dot 4,4:Color 0,255,19:Dot 5,4:Dot 6,4:Dot 7,4:Dot 8,4:Color 0,254,16:Dot 9,4:Dot 10,4:Color 0,244,21:Dot 11,4:Color 0,219,20:Dot 12,4:Color 0,178,8:Dot 13,4:Color 9,138,0:Dot 14,4:Color 0,75,2:Dot 15,4:Color 0,0,0:Dot 16,4
Dot 0,5:Color 0,244,21:Dot 1,5:Color 0,255,19:Dot 2,5:Color 0,244,21:Dot 3,5:Color 0,255,19:Dot 4,5:Dot 5,5:Dot 6,5:Color 0,254,16:Dot 7,5:Dot 8,5:Dot 9,5:Dot 10,5:Color 0,244,21:Dot 11,5:Color 0,219,20:Dot 12,5:Color 0,187,3:Dot 13,5:Color 0,147,15:Dot 14,5:Color 0,93,9:Dot 15,5:Color 0,0,0:Dot 16,5
Dot 0,6:Color 0,255,19:Dot 1,6:Dot 2,6:Dot 3,6:Dot 4,6:Color 0,254,16:Dot 5,6:Color 0,244,21:Dot 6,6:Color 0,255,19:Dot 7,6:Dot 8,6:Dot 9,6:Color 0,254,16:Dot 10,6:Color 0,243,19:Dot 11,6:Color 0,218,17:Dot 12,6:Color 0,183,17:Dot 13,6:Color 0,147,15:Dot 14,6:Color 0,101,7:Dot 15,6:Color 0,0,0:Dot 16,6
Color 0,219,20:Dot 0,7:Color 0,255,19:Dot 1,7:Dot 2,7:Dot 3,7:Color 0,244,21:Dot 4,7:Color 0,255,19:Dot 5,7:Dot 6,7:Dot 7,7:Color 0,254,16:Dot 8,7:Color 0,255,19:Dot 9,7:Color 0,244,21:Dot 10,7:Color 0,228,12:Dot 11,7:Color 0,206,17:Dot 12,7:Color 0,183,17:Dot 13,7:Color 0,142,5:Dot 14,7:Color 3,98,5:Dot 15,7:Color 0,75,2:Dot 16,7
Color 0,219,20:Dot 0,8:Color 0,255,19:Dot 1,8:Dot 2,8:Dot 3,8:Dot 4,8:Dot 5,8:Dot 6,8:Dot 7,8:Dot 8,8:Color 0,254,16:Dot 9,8:Color 0,243,19:Dot 10,8:Color 0,219,20:Dot 11,8:Color 9,191,12:Dot 12,8:Color 0,167,10:Dot 13,8:Color 0,133,8:Dot 14,8:Color 0,93,9:Dot 15,8:Color 0,75,2:Dot 16,8
Color 9,191,12:Dot 0,9:Color 0,244,21:Dot 1,9:Color 0,255,19:Dot 2,9:Dot 3,9:Dot 4,9:Dot 5,9:Dot 6,9:Dot 7,9:Color 0,254,16:Dot 8,9:Color 0,244,21:Dot 9,9:Color 0,228,12:Dot 10,9:Color 0,206,17:Dot 11,9:Color 0,183,17:Dot 12,9:Color 0,147,15:Dot 13,9:Color 2,117,2:Dot 14,9:Color 4,90,7:Dot 15,9:Color 0,75,2:Dot 16,9
Color 0,0,0:Dot 0,10:Color 0,226,5:Dot 1,10:Color 0,244,21:Dot 2,10:Color 0,255,19:Dot 3,10:Dot 4,10:Dot 5,10:Color 0,244,21:Dot 6,10:Color 0,255,19:Dot 7,10:Color 0,243,19:Dot 8,10:Color 0,228,12:Dot 9,10:Color 0,206,17:Dot 10,10:Color 9,191,12:Dot 11,10:Color 0,167,10:Dot 12,10:Color 0,134,10:Dot 13,10:Color 0,101,7:Dot 14,10:Color 0,79,5:Dot 15,10:Color 0,0,0:Dot 16,10
Dot 0,11:Color 0,183,17:Dot 1,11:Color 0,219,20:Dot 2,11:Color 0,243,19:Dot 3,11:Color 0,244,21:Dot 4,11:Dot 5,11:Color 0,243,19:Dot 6,11:Color 0,228,12:Dot 7,11:Color 0,219,20:Dot 8,11:Color 0,206,17:Dot 9,11:Color 0,183,17:Dot 10,11:Color 0,167,10:Dot 11,11:Color 0,146,13:Dot 12,11:Color 0,112,8:Dot 13,11:Color 0,87,4:Dot 14,11:Color 0,70,6:Dot 15,11:Color 0,0,0:Dot 16,11
Dot 0,12:Color 0,134,10:Dot 1,12:Color 9,191,12:Dot 2,12:Color 0,206,17:Dot 3,12:Color 0,219,20:Dot 4,12:Dot 5,12:Color 0,218,17:Dot 6,12:Color 0,206,17:Dot 7,12:Color 0,197,0:Dot 8,12:Color 0,183,17:Dot 9,12:Color 0,167,10:Dot 10,12:Color 0,134,10:Dot 11,12:Color 0,112,8:Dot 12,12:Color 4,90,7:Dot 13,12:Color 0,79,5:Dot 14,12:Color 0,70,6:Dot 15,12:Color 0,0,0:Dot 16,12
Dot 0,13:Dot 1,13:Color 7,128,2:Dot 2,13:Color 0,183,17:Dot 3,13:Dot 4,13:Dot 5,13:Dot 6,13:Dot 7,13:Color 0,167,10:Dot 8,13:Color 0,153,5:Dot 9,13:Color 0,134,10:Dot 10,13:Color 0,112,8:Dot 11,13:Color 0,93,9:Dot 12,13:Color 0,79,5:Dot 13,13:Color 0,70,6:Dot 14,13:Color 0,0,0:Dot 15,13:Dot 16,13
Dot 0,14:Dot 1,14:Dot 2,14:Color 0,101,7:Dot 3,14:Color 0,147,15:Dot 4,14:Dot 5,14:Dot 6,14:Dot 7,14:Color 0,134,10:Dot 8,14:Color 0,112,8:Dot 9,14:Color 0,101,7:Dot 10,14:Color 0,87,4:Dot 11,14:Color 0,79,5:Dot 12,14:Color 0,70,6:Dot 13,14:Color 0,0,0:Dot 14,14:Dot 15,14:Dot 16,14
Dot 0,15:Dot 1,15:Dot 2,15:Dot 3,15:Color 0,79,5:Dot 4,15:Color 0,93,9:Dot 5,15:Color 5,99,7:Dot 6,15:Dot 7,15:Color 0,93,9:Dot 8,15:Color 4,90,7:Dot 9,15:Color 0,79,5:Dot 10,15:Color 0,70,6:Dot 11,15:Dot 12,15:Color 0,0,0:Dot 13,15:Dot 14,15:Dot 15,15:Dot 16,15
Dot 0,16:Dot 1,16:Dot 2,16:Dot 3,16:Dot 4,16:Dot 5,16:Dot 6,16:Color 0,78,4:Dot 7,16:Dot 8,16:Dot 9,16:Color 0,0,0:Dot 10,16:Dot 11,16:Dot 12,16:Dot 13,16:Dot 14,16:Dot 15,16:Dot 16,16
DrawToScreen
Return img
EndFunction
Function GenImageProton()
img=MakeImage(17,17)
DrawToImage img
Color 0,0,0:Dot 0,0:Dot 1,0:Dot 2,0:Dot 3,0:Dot 4,0:Dot 5,0:Dot 6,0:Color 220,0,0:Dot 7,0:Dot 8,0:Color 198,1,0:Dot 9,0:Color 0,0,0:Dot 10,0:Dot 11,0:Dot 12,0:Dot 13,0:Dot 14,0:Dot 15,0:Dot 16,0
Dot 0,1:Dot 1,1:Dot 2,1:Dot 3,1:Color 219,0,2:Dot 4,1:Color 244,0,0:Dot 5,1:Color 255,0,0:Dot 6,1:Dot 7,1:Dot 8,1:Color 244,0,0:Dot 9,1:Color 228,0,0:Dot 10,1:Color 185,0,0:Dot 11,1:Color 130,0,0:Dot 12,1:Color 0,0,0:Dot 13,1:Dot 14,1:Dot 15,1:Dot 16,1
Dot 0,2:Dot 1,2:Dot 2,2:Color 229,0,0:Dot 3,2:Color 255,0,0:Dot 4,2:Dot 5,2:Dot 6,2:Dot 7,2:Dot 8,2:Dot 9,2:Dot 10,2:Color 228,0,0:Dot 11,2:Color 193,0,0:Dot 12,2:Color 130,0,0:Dot 13,2:Color 0,0,0:Dot 14,2:Dot 15,2:Dot 16,2
Dot 0,3:Dot 1,3:Color 229,0,0:Dot 2,3:Color 255,0,0:Dot 3,3:Dot 4,3:Dot 5,3:Dot 6,3:Dot 7,3:Dot 8,3:Dot 9,3:Color 251,0,2:Dot 10,3:Color 243,0,0:Dot 11,3:Color 208,0,0:Dot 12,3:Color 169,0,0:Dot 13,3:Color 106,0,1:Dot 14,3:Color 0,0,0:Dot 15,3:Dot 16,3
Dot 0,4:Color 228,0,0:Dot 1,4:Color 255,0,0:Dot 2,4:Dot 3,4:Dot 4,4:Dot 5,4:Dot 6,4:Dot 7,4:Dot 8,4:Dot 9,4:Color 251,0,2:Dot 10,4:Color 244,0,0:Dot 11,4:Color 219,0,2:Dot 12,4:Color 184,0,0:Dot 13,4:Color 141,1,0:Dot 14,4:Color 77,0,0:Dot 15,4:Color 0,0,0:Dot 16,4
Dot 0,5:Color 244,0,0:Dot 1,5:Color 255,0,0:Dot 2,5:Dot 3,5:Dot 4,5:Dot 5,5:Dot 6,5:Dot 7,5:Dot 8,5:Dot 9,5:Dot 10,5:Color 244,0,0:Dot 11,5:Color 219,0,2:Dot 12,5:Color 185,0,0:Dot 13,5:Color 141,1,0:Dot 14,5:Color 90,2,0:Dot 15,5:Color 0,0,0:Dot 16,5
Dot 0,6:Color 255,0,0:Dot 1,6:Dot 2,6:Dot 3,6:Dot 4,6:Dot 5,6:Dot 6,6:Dot 7,6:Dot 8,6:Dot 9,6:Color 251,0,2:Dot 10,6:Color 243,0,0:Dot 11,6:Color 216,0,0:Dot 12,6:Color 185,0,0:Dot 13,6:Color 148,0,1:Dot 14,6:Color 101,3,0:Dot 15,6:Color 0,0,0:Dot 16,6
Color 220,0,0:Dot 0,7:Color 255,0,0:Dot 1,7:Dot 2,7:Dot 3,7:Dot 4,7:Dot 5,7:Dot 6,7:Dot 7,7:Dot 8,7:Dot 9,7:Color 251,0,2:Dot 10,7:Color 228,0,0:Dot 11,7:Color 208,0,0:Dot 12,7:Color 184,0,0:Dot 13,7:Color 148,0,1:Dot 14,7:Color 106,0,1:Dot 15,7:Color 77,0,0:Dot 16,7
Color 220,0,0:Dot 0,8:Color 255,0,0:Dot 1,8:Dot 2,8:Dot 3,8:Dot 4,8:Dot 5,8:Dot 6,8:Dot 7,8:Dot 8,8:Dot 9,8:Color 243,0,0:Dot 10,8:Color 219,0,2:Dot 11,8:Color 188,5,2:Dot 12,8:Color 164,1,0:Dot 13,8:Color 128,0,0:Dot 14,8:Color 94,0,0:Dot 15,8:Color 77,0,0:Dot 16,8
Color 198,1,0:Dot 0,9:Color 244,0,0:Dot 1,9:Color 255,0,0:Dot 2,9:Dot 3,9:Dot 4,9:Dot 5,9:Dot 6,9:Dot 7,9:Dot 8,9:Color 243,0,0:Dot 9,9:Color 222,1,0:Dot 10,9:Color 208,0,0:Dot 11,9:Color 185,0,0:Dot 12,9:Color 153,2,0:Dot 13,9:Color 117,0,2:Dot 14,9:Color 87,0,1:Dot 15,9:Color 77,0,0:Dot 16,9
Color 0,0,0:Dot 0,10:Color 228,0,0:Dot 1,10:Color 251,0,2:Dot 2,10:Dot 3,10:Color 255,0,0:Dot 4,10:Dot 5,10:Dot 6,10:Color 244,0,0:Dot 7,10:Color 233,0,1:Dot 8,10:Color 229,0,0:Dot 9,10:Color 208,0,0:Dot 10,10:Color 193,0,0:Dot 11,10:Color 164,1,0:Dot 12,10:Color 131,2,0:Dot 13,10:Color 100,1,0:Dot 14,10:Color 79,1,2:Dot 15,10:Color 0,0,0:Dot 16,10
Dot 0,11:Color 185,0,0:Dot 1,11:Color 220,0,0:Dot 2,11:Color 243,0,0:Dot 3,11:Color 244,0,0:Dot 4,11:Color 243,0,0:Dot 5,11:Dot 6,11:Color 229,0,0:Dot 7,11:Color 222,1,0:Dot 8,11:Color 208,0,0:Dot 9,11:Color 185,0,0:Dot 10,11:Color 164,1,0:Dot 11,11:Color 148,0,1:Dot 12,11:Color 113,0,0:Dot 13,11:Color 86,0,0:Dot 14,11:Color 77,0,0:Dot 15,11:Color 0,0,0:Dot 16,11
Dot 0,12:Color 131,2,0:Dot 1,12:Color 188,5,2:Dot 2,12:Color 210,3,0:Dot 3,12:Color 219,0,2:Dot 4,12:Color 216,0,0:Dot 5,12:Color 219,0,2:Dot 6,12:Color 210,3,0:Dot 7,12:Color 196,0,0:Dot 8,12:Color 184,0,0:Dot 9,12:Color 164,1,0:Dot 10,12:Color 136,0,1:Dot 11,12:Color 117,0,0:Dot 12,12:Color 87,0,1:Dot 13,12:Color 77,0,0:Dot 14,12:Color 69,0,0:Dot 15,12:Color 0,0,0:Dot 16,12
Dot 0,13:Dot 1,13:Color 130,0,0:Dot 2,13:Color 172,0,1:Dot 3,13:Color 184,0,0:Dot 4,13:Color 185,0,0:Dot 5,13:Color 184,0,0:Dot 6,13:Dot 7,13:Color 164,1,0:Dot 8,13:Color 153,2,0:Dot 9,13:Color 136,0,1:Dot 10,13:Color 113,0,0:Dot 11,13:Color 94,0,0:Dot 12,13:Color 84,0,0:Dot 13,13:Color 69,1,1:Dot 14,13:Color 0,0,0:Dot 15,13:Dot 16,13
Dot 0,14:Dot 1,14:Dot 2,14:Color 106,0,1:Dot 3,14:Color 136,0,1:Dot 4,14:Color 148,0,1:Dot 5,14:Color 141,1,0:Dot 6,14:Color 148,0,1:Dot 7,14:Color 136,0,1:Dot 8,14:Color 113,0,0:Dot 9,14:Color 100,1,0:Dot 10,14:Color 86,0,0:Dot 11,14:Color 77,0,0:Dot 12,14:Color 69,1,1:Dot 13,14:Color 0,0,0:Dot 14,14:Dot 15,14:Dot 16,14
Dot 0,15:Dot 1,15:Dot 2,15:Dot 3,15:Color 79,1,2:Dot 4,15:Color 90,2,0:Dot 5,15:Color 106,0,1:Dot 6,15:Color 94,0,0:Dot 7,15:Dot 8,15:Color 90,2,0:Dot 9,15:Color 77,0,0:Dot 10,15:Color 76,0,0:Dot 11,15:Color 69,0,0:Dot 12,15:Color 0,0,0:Dot 13,15:Dot 14,15:Dot 15,15:Dot 16,15
Dot 0,16:Dot 1,16:Dot 2,16:Dot 3,16:Dot 4,16:Dot 5,16:Dot 6,16:Color 76,0,0:Dot 7,16:Color 77,0,0:Dot 8,16:Dot 9,16:Color 0,0,0:Dot 10,16:Dot 11,16:Dot 12,16:Dot 13,16:Dot 14,16:Dot 15,16:Dot 16,16
DrawToScreen
Return img
EndFunction

HotSpot ON
AtomImages(0)=GenImageProton()
AtomImages(1)=GenImageNeutron()
AtomImages(2)=GenImageElectron()
HotSpot OFF
Color cbwhite

Function MakeGame(energy,hyd1,hyd2,hyd3,neut)
ScrHalfW=ScreenWidth()/2
ScrHalfH=ScreenHeight()/2
Randomize Timer()
giveEnergy=energy/(hyd1+hyd2+hyd3+neut)
For i=1 To hyd1
AT.ATOM=New(ATOM)
AT\Material=1
dist#=Rnd(0,MAX_Senter_Dist)
angle#=Rnd(360)
AT\X=ScrHalfW+Cos(angle)*dist
AT\Y=ScrHalfH+Sin(angle)*dist
AT\ElectAngle=Rnd(360)
AT\Energy=giveEnergy
Next i
For i=1 To hyd2
AT.ATOM=New(ATOM)
AT\Material=2
dist#=Rnd(0,MAX_Senter_Dist)
angle=Rnd(360)
AT\X=ScrHalfW+Cos(angle)*dist
AT\Y=ScrHalfH+Sin(angle)*dist
AT\ElectAngle=Rnd(360)
AT\Energy=giveEnergy
Next i
For i=1 To hyd3
AT.ATOM=New(ATOM)
AT\Material=3
dist#=Rnd(0,MAX_Senter_Dist)
angle=Rnd(360)
AT\X=ScrHalfW+Cos(angle)*dist
AT\Y=ScrHalfH+Sin(angle)*dist
AT\ElectAngle=Rnd(360)
AT\Energy=giveEnergy
Next i
For i=1 To neut
AT.ATOM=New(ATOM)
AT\Material=4
dist#=Rnd(0,MAX_Senter_Dist)
angle=Rnd(360)
AT\X=ScrHalfW+Cos(angle)*dist
AT\Y=ScrHalfH+Sin(angle)*dist
AT\ElectAngle=Rnd(360)
AT\Energy=giveEnergy
Next i
EndFunction

Function DrawATOMS()
For AT.ATOM=Each ATOM
Select AT\Material
Case 1
DrawImage AtomImages(0),AT\X,AT\Y
dx#=AT\X+Cos(AT\ElectAngle)*(AT\Energy/10.0-(AT\SpeedX+AT\SpeedY))
dy#=AT\Y+Sin(AT\ElectAngle)*(AT\Energy/10.0-(AT\SpeedX+AT\SpeedY))
DrawImage AtomImages(2),dx#,dy#
Case 2
DrawImage AtomImages(0),AT\X-8,AT\Y
DrawImage AtomImages(1),AT\X+8,AT\Y
dx#=AT\X+Cos(AT\ElectAngle)*(AT\Energy/10.0-(AT\SpeedX+AT\SpeedY))
dy#=AT\Y+Sin(AT\ElectAngle)*(AT\Energy/10.0-(AT\SpeedX+AT\SpeedY))
DrawImage AtomImages(2),dx#,dy#
Case 3
DrawImage AtomImages(0),AT\X-8,AT\Y
DrawImage AtomImages(1),AT\X+8,AT\Y
DrawImage AtomImages(1),AT\X,AT\Y-14
dx#=AT\X+Cos(AT\ElectAngle)*(AT\Energy/10.0-(AT\SpeedX+AT\SpeedY))
dy#=AT\Y+Sin(AT\ElectAngle)*(AT\Energy/10.0-(AT\SpeedX+AT\SpeedY))
DrawImage AtomImages(2),dx#,dy#
Case 4
DrawImage AtomImages(1),AT\X,AT\Y
Case 5
DrawImage AtomImages(0),AT\X-8,AT\Y
DrawImage AtomImages(1),AT\X+8,AT\Y
DrawImage AtomImages(1),AT\X-16,AT\Y-14
DrawImage AtomImages(0),AT\X,AT\y-14
dx#=Cos(AT\ElectAngle)*(AT\Energy/10.0-(AT\SpeedX+AT\SpeedY))+10
dy#=Sin(AT\ElectAngle)*(AT\Energy/10.0-(AT\SpeedX+AT\SpeedY))+10
DrawImage AtomImages(2),AT\X+dx#,AT\Y+dy#
DrawImage AtomImages(2),AT\X-dx#,AT\Y-dy#
EndSelect
Next AT
EndFunction


Function CalculatePhysics(x=400,y=300)
Fusion_NSpeedX=0
Fusion_NSpeedY=0
Count=0
For AT.ATOM=Each ATOM
For AT2.ATOM=Each ATOM
If AT<>AT2
dist#=Distance(AT\X,AT\Y,AT2\X,AT2\Y)
If dist#<Max(Min((AT\Energy*10-(AT\SpeedX+AT\SpeedY)),50),0)
angle#=GetAngle(AT\X,AT\Y,x,y)
power# = AT\Energy*10 / (dist#+20)^2
accelationX#=Cos(angle#)*power#
accelationY#=-Sin(angle#)*power#
AT\SpeedX=AT\SpeedX - accelationX#
AT\SpeedY=AT\SpeedY - accelationY#
AT2\SpeedX=AT2\SpeedX + accelationX#
AT2\SpeedY=AT2\SpeedY + accelationY#
EndIf
EndIf
Next AT2
dist#=Distance(AT\X,AT\Y,x,y)
If dist#>MAX_Senter_Dist+10-Presure And AT\Material<>AT_Helium
angle#=GetAngle(AT\X,AT\Y,x,y)
power# = (100000.0-Presure) / (dist#+20)^2
accelationX#=Cos(angle#)*power#
accelationY#=-Sin(angle#)*power#
AT\SpeedX=AT\SpeedX + accelationX#
AT\SpeedY=AT\SpeedY + accelationY#
EndIf
If AT\Material=AT_Helium
angle#=GetAngle(AT\X,AT\Y,x,y)
power# = (10000.0+Presure) / (dist#+20)^2
accelationX#=Cos(angle#)*power#
accelationY#=-Sin(angle#)*power#
AT\SpeedX=AT\SpeedX - accelationX#
AT\SpeedY=AT\SpeedY - accelationY#
If dist#>1000 Then Delete AT
EndIf

AT\Electangle=WrapAngle(AT\Electangle+3)
Count=Count+1
Fusion_NSpeedX=Fusion_NSpeedX+Abs(AT\SpeedX)
Fusion_NSpeedY=Fusion_NSpeedY+Abs(AT\SpeedY)
Next AT
Fusion_NSpeedX=Fusion_NSpeedX/Count
Fusion_NSpeedY=Fusion_NSpeedY/Count
EndFunction

Function UpdatePhysics()
PickATOM.ATOM=NULL
fDist#=50.0
For AT.ATOM=Each ATOM
AT\SpeedX=AT\SpeedX*Friction
AT\SpeedY=AT\SpeedY*Friction
AT\X=AT\X+AT\SpeedX
AT\Y=AT\Y+AT\SpeedY
Next AT
EndFunction



Function Fusion()
PickATOM.ATOM=NULL
fDist#=50.0
For AT.ATOM=Each ATOM
If Timer()<Fusion_Timer
For AT2.ATOM=Each ATOM
If AT<>AT2 And Distance(AT\X,AT\Y,AT2\X,AT2\Y)<20 And Abs(AT\SpeedX)>Fusion_SpeedX And Abs(AT\SpeedY)>Fusion_SpeedY
If AT\Material=AT_Hydrogen2 And AT2\Material=AT_Hydrogen2

AT\Material=AT_Helium
Fusion_Energy=Fusion_Energy+(AT\Energy+AT2\Energy)-(AT\Energy/2+AT2\Energy/2)
AT\Energy=AT\Energy/3+AT2\Energy/3
If (Abs(AT\SpeedX)+Abs(AT\SpeedY))/2<(Abs(AT2\SpeedX)+Abs(AT2\SpeedY))/2
AT\SpeedX=AT2\SpeedX
AT\SpeedY=AT2\SpeedY
EndIf
Delete AT2

ElseIf AT\Material=AT_Hydrogen And AT2\Material=AT_Hydrogen3
AT\Material=AT_Helium
AT\Energy=AT\Energy/2
Fusion_Energy=Fusion_Energy+(AT\Energy+AT2\Energy)-(AT\Energy/2+AT2\Energy/3)
If (Abs(AT\SpeedX)+Abs(AT\SpeedY))/2<(Abs(AT2\SpeedX)+Abs(AT2\SpeedY))/2
AT\SpeedX=AT2\SpeedX
AT\SpeedY=AT2\SpeedY
EndIf
Delete AT2

ElseIf AT\Material=AT_Hydrogen And AT2\Material=AT_Neutron
AT\Material=AT_Hydrogen2
AT\Energy=AT\Energy+AT2\Energy
If (Abs(AT\SpeedX)+Abs(AT\SpeedY))/2<(Abs(AT2\SpeedX)+Abs(AT2\SpeedY))/2
AT\SpeedX=AT2\SpeedX
AT\SpeedY=AT2\SpeedY
EndIf
Delete AT2

ElseIf AT\Material=AT_Neutron And AT2\Material=AT_Hydrogen2
AT\Material=AT_Hydrogen3
AT\Energy=AT\Energy+AT2\Energy
If (Abs(AT\SpeedX)+Abs(AT\SpeedY))/2<(Abs(AT2\SpeedX)+Abs(AT2\SpeedY))/2
AT\SpeedX=AT2\SpeedX
AT\SpeedY=AT2\SpeedY
EndIf
Delete AT2
ElseIf AT\Material=AT_Hydrogen3 And AT2\Material=AT_Hydrogen3
AT\Material=AT_Helium
Fusion_Energy=Fusion_Energy+(AT\Energy+AT2\Energy)-(AT\Energy/4+AT2\Energy/4)
AT2\Material=4
AT3.ATOM=New(ATOM)
AT3\Material=4
AT3\X=(AT\X+AT2\X)/2
AT3\Y=(AT\Y+AT2\Y)/2
If (Abs(AT\SpeedX)+Abs(AT\SpeedY))/2<(Abs(AT2\SpeedX)+Abs(AT2\SpeedY))/2
AT\SpeedX=AT2\SpeedX
AT\SpeedY=AT2\SpeedY
EndIf
ElseIf AT\Material=AT_Hydrogen3 And AT2\Material=AT_Hydrogen2
Fusion_Energy=Fusion_Energy+(AT\Energy+AT2\Energy)-(AT\Energy/3+AT2\Energy/4)
AT\Material=AT_Helium
AT\Energy=AT\Energy/3+AT2\Energy/2
AT2\Material=4
If (Abs(AT\SpeedX)+Abs(AT\SpeedY))/2<(Abs(AT2\SpeedX)+Abs(AT2\SpeedY))/2
AT\SpeedX=AT2\SpeedX
AT\SpeedY=AT2\SpeedY
EndIf
EndIf
EndIf
Next AT2
EndIf
dist#=Distance(AT\X,AT\Y,MouseX(),MouseY())
If MouseDown(1) And dist#<60 And IsPicked=False
If dist#<fDist#
fDist#=dist#
SPickATOM=ConvertToInteger(AT)
EndIf
EndIf

Next AT

PickATOM.ATOM=ConvertToType(SPickATOM)
If PickATOM<>NULL
IsPicked=True
angle#=-GetAngle(PickATOM\X,PickATOM\Y,MouseX(),MouseY())+180
dist#=Distance(PickATOM\X,PickATOM\Y,MouseX(),MouseY())
PickATOM\SpeedX=PickATOM\SpeedX-Cos(angle#)
PickATOM\SpeedY=PickATOM\SpeedY-Sin(angle#)
EndIf

If MouseUp(1)
If PickATOM<>NULL
PickATOM\SpeedX=PickATOM\SpeedX*3
PickATOM\SpeedY=PickATOM\SpeedY*3
Fusion_LineX1=MouseX()
Fusion_LineY1=MouseY()
Fusion_Timer=Timer()+500
EndIf
SPickATOM=ConvertToInteger(NULL)
IsPicked=False
EndIf

If MouseDown(2) Then
Presure=Max(Min(Presure+1,100),0)
Else
If Presure>0 Then Presure-5
EndIf

size#=MAX_Senter_Dist+10-Presure
Circle 400-size/2,300-size/2,size,OFF

EndFunction


Function MainLoop()
Repeat
CalculatePhysics(Fusion_CenterX,Fusion_CenterY)
UpdatePhysics()
Fusion()
DrawATOMS()
If KeyHit(cbkeyr) Then
For AT.ATOM=Each ATOM
Delete AT
Next AT
MakeGame(Rand(1000,30000),Rand(1,20),Rand(1,20),Rand(1,20),Rand(1,20))
Fusion_Energy=0
EndIf
Text 0,0,"Fps: "+FPS()
Text 0,12,"Hit R to reset game."
Text 0,24,"Relased Energy:"+Fusion_Energy
DrawScreen
Forever
EndFunction

MakeGame(10000, 30, 0, 0, 30)
MainLoop()
Kyllä minä osaan, mutta kun mieli on tällasen kaaoksen vallassa, niin ei siitä mitään tule.
Vouldenhaul
Active Member
Posts: 211
Joined: Tue Aug 28, 2007 3:48 pm

Re: Pikku-Pelit.

Post by Vouldenhaul »

Pitääpä päästä taas mainostamaan... :D

Eli, jos erilaiset Pienet Pelit kiinnostaa, niin nyt on mahdollisuus ladata 25 eri pikku peliä yhdellä kerralla. Drahtlose productions on tehnyt Pienet Pelit -kokoelman, josta löytyy pelejä jokaisen makuun. Siellä on niin CB:n käyttäjien, kuin tiimin omiakin pelejä. Löydät täysin ennen julkaisemattomia pelejä ja tutuksi tulleita klassikoita, kuten myös kilpailumenestyjiäkin. 3D:tä ollaan saatu mukaan... Kaikki ollaan nivottu kätevästi yhteen valikkoon, josta voit valita haluamasi pelit. Lisäksi voit kuunnella kahta Drahtlose productionssille yksinoikeutettua musiikkikappaletta ja käyttää CB:n peleissä viellä melko harvinaisia nettiominaisuuksia. Lisäksi paljon muuta, jonka näet lataamalla pelin osoitteesta http://rudolf.2.forumer.com/index.php?a ... ost&id=374 .

Itse pikku-peli topicciin siirtyäkseni, niin oli ehdottoman hyvä saada se pelastettua vanhoilta foorumeilta tänne. Aina ei jaksa aloittaa vuoden peliprojektia, joten kaikki yhden illan tuotokset on hauska lisätä tänne. Sisältöäkin ollaan saatu heti topicin alkajaisiksi sopivan paljon...
Some stories can't be told by words...
Some legends are meant to die...
Some bloodlines must come to an end...


Metal Gear Solid 4: Guns of the Patriots
Sneaking Out 12.06.2008
Mysterius Coder
Active Member
Posts: 133
Joined: Mon Aug 27, 2007 8:13 pm

Re: Pikku-Pelit.

Post by Mysterius Coder »

Näitäkihän voisi tunkea sinne pieniin peleihin. :!: Tekijöiltä vaan pitäs kysäsätä.
Kyllä minä osaan, mutta kun mieli on tällasen kaaoksen vallassa, niin ei siitä mitään tule.
Post Reply