- BounCE - A relaxing bouncy ball 'simulator'
- 18 Dec 2018 10:08:21 am
- Last edited by Legoman314 on 11 Mar 2019 06:43:25 pm; edited 6 times in total
Introducing BounCE
A fun bouncing ball simulator written in ICE. This is a lot like Bouncy Ball Simulator by _ipheonix_, except that it will not be as optimized, since it is be made by a beginner.
Features:
-The ability to accelerate the ball in any direction
-The ability to change the ball and background colors
-Change the ball from a circle to a square
-More features coming soon!
here is the code:
Code:
To do:
-Fix any bugs
Feel free to post suggestions and/or helpful comments.
A fun bouncing ball simulator written in ICE. This is a lot like Bouncy Ball Simulator by _ipheonix_, except that it will not be as optimized, since it is be made by a beginner.
Features:
-The ability to accelerate the ball in any direction
-The ability to change the ball and background colors
-Change the ball from a circle to a square
-More features coming soon!
here is the code:
Code:
[i]A
Begin
55->GRAV->L1(1)
5->VAIR->L1(2)
5->HAIR->L1(3)
[i]---INTRO
FillScreen(0
SetTextBGColor(0
SetTextScale(6,6
SetTextFGColor(224
PrintStringXY("unCE",114,20
SetTextFGColor(24
PrintStringXY("Boun",18,20
SetTextScale(2,2
SetTextFGColor(31
PrintStringXY("A fun physics game",35,100
PrintStringXY("By Legoman314",98,130
SetTextFGColor(15
SetTextScale(1,1
PrintStringXY("Press [ENTER]",110,225
SetColor(15
For(Y,0,4000
If getKey(9)=1:4000->Y
End
End
For(Y,0,200,1
FillCircle(160,120,Y
Pause 1
End
[i]---SETUP
SetTextFGColor(112
SetTextTransparentColor(1
SetTextBGColor(0
0->XV->YV->X->Y->BC->T
1->C
20->S
15->FC
1->SETNUM
SetColor(255
Lbl MAINLOOP:getKey->K
[i]-------MAIN LOOP-------
While K!=15 and K!=55
getKey->K
[i]---ACCELERATION
If getKey(1)=1:YV+100->YV
End
If getKey(2)=1:XV-100->XV
End
If getKey(3)=1:XV+100->XV
End
If getKey(4)=1:YV-100->YV
End
[i]---SIZE
If getKey(54)=1:min(239,S+1)->S
End
If getKey(48)=1:max(1,S-1)->S
End
[i]---COLOR
If getKey(40)=1:FC+1->FC
End
If getKey(32)=1:BC-1->BC
End
[i]---CIRCULARITY
If K=47:not(C)->C
End
[i]---RESET
If getKey(53)=1:0->X->Y->XV->YV->BC:20->S:15->FC
End
[i]---TIMEOUT
If K!=0:0->T
End
If T>=700:15->K
End
X+((2*(XV<8388608)-1)*((sqrt(XV*XV)/100))->X
Y+((2*(YV<8388608)-1)*((sqrt(YV*YV)/100))->Y
[i]---COLLISION DETECTION
If Y>500:0->Y:~1*YV->YV
End
If Y>240-S:240-S->Y:~1*YV->YV
End
If X>500:0->X:~1*XV->XV
End
If X>320-S:320-S->X:~1*XV->XV
End
[i]---RENDERING
SetDraw(1
FillScreen(BC
SetColor(FC
If C=1:FillCircle(X+S/2,Y+S/2,S/2-1
End
If C!=1:FillRectangle(X,Y,S,S
End
SetTextXY(10,10
[i]PrintUInt(K,2
SetTextXY(10,25
[i]PrintUInt(YV,2
SwapDraw
T+1->T
[i]---GRAVITY/AIR RESITANCE
YV+GRAV->YV
YV+(2*(YV>8388608)-1)*VAIR->YV
XV+(2*(XV>8388608)-1)*HAIR->XV
End
If K=55:Goto SETTINGS
End
If K=15:Goto EXIT
End
[i]-------SETTINGS--------
Lbl SETTINGS:0->K:1->SETNUM:1->L1(1)
[i]---BACKGROUND
SetColor(FC
FillRectangle(0,0,320,240
SetColor(0
FillRectangle(6,6,308,228
SetTextFGColor(87
SetTextScale(4,4
PrintStringXY("SETTINGS",32,10
While K!=15 and K!=55
[i]---NAVIGATION
If K=2:L1(1)-1->L1(1)
End
If K=3:L1(1)+1->L1(1)
End
[i]---MENU
SetTextScale(1,1
SetTextFGColor(23
[i]-BACKGROUN DRAW
FillRectangle(6,6,308,228
[i]-GRAVITY
PrintStringXY("GRAVITY: < >",15,50
SetTextXY(83,50
[i]L1(1)->B
PrintUInt(L1(1),3
SwapDraw
End
Goto MAINLOOP
Lbl EXIT:
det(1
To do:
-Fix any bugs
Feel free to post suggestions and/or helpful comments.