|
Post by chaosshadic456 on Apr 7, 2012 19:18:39 GMT -5
hey guys, i'm new coding, soo i need a code of a simple menu for my project "project streak v2.0(update of the version 1.0)", please
|
|
epikhbk1
Full Member
Today's Friend is tomorrows foe.
Posts: 190
|
Post by epikhbk1 on Apr 12, 2012 10:39:27 GMT -5
yeeah i dont think youll get any replies...
|
|
epikhbk1
Full Member
Today's Friend is tomorrows foe.
Posts: 190
|
Post by epikhbk1 on Apr 12, 2012 11:09:52 GMT -5
heres a quick menuGraphics3D 800,600,0,2 SetBuffer BackBuffer() font=LoadFont("Arial",15) SetFont font
While result=0 result=MainMenu() ;put these options inside the menu loop, as these ;return 0 - continuing the mainmenu loop. If result=2 Then result=Options() If result=3 Then result=Credits() Wend If result=1 Then StartGame() ;if the result isn't 1, then it must be 4 - hence QUIT End
Function MainMenu() Cls Text 400,50,"My Menu",1,1 Rect 300,100,200,50,0 Text 400,125,"Start Game",1,1 Rect 300,200,200,50,0 Text 400,225,"Options",1,1 Rect 300,300,200,50,0 Text 400,325,"Credits",1,1 Rect 300,400,200,50,0 Text 400,425,"Quit",1,1 Flip result=0 While result=0 mx=MouseX():my=MouseY() If MouseHit(1) Then If RectsOverlap(300,100,200,50,mx,my,1,1) Then result = 1 If RectsOverlap(300,200,200,50,mx,my,1,1) Then result = 2 If RectsOverlap(300,300,200,50,mx,my,1,1) Then result = 3 If RectsOverlap(300,400,200,40,mx,my,1,1) Then result = 4 End If Wend Return result End Function
Function Options() Cls Text 400,300,"Options Screen! Any key to return to main menu",1,1 Flip WaitKey() Return 0 End Function
Function Credits() Cls Text 400,300,"Credits!!",1,1 Text 400,330,"Made by epikhbk1",1,1 Text 400,400,"Any key to return",1,1 Flip WaitKey() Return 0 End Function
Function StartGame() Cls Text 400,300,"AND you're away...",1,1 Text 400,400,"ESC to exit",1,1 Flip While Not KeyHit(1):Wend End End Function
|
|
|
Post by chaosshadic456 on Apr 12, 2012 11:11:08 GMT -5
thanks, very much!
|
|
epikhbk1
Full Member
Today's Friend is tomorrows foe.
Posts: 190
|
Post by epikhbk1 on Apr 12, 2012 11:22:10 GMT -5
no prob ;D
|
|
|
Post by chaosshadic456 on Apr 12, 2012 11:31:49 GMT -5
in "sonic the hedgehog.bb" where do I have to put the code?
|
|
epikhbk1
Full Member
Today's Friend is tomorrows foe.
Posts: 190
|
Post by epikhbk1 on Apr 12, 2012 11:39:47 GMT -5
well first u tell me somthing for a change...how can i add a grading system?
|
|
|
Post by chaosshadic456 on Apr 12, 2012 11:48:11 GMT -5
i have no idea, ask for jloy2.
|
|
epikhbk1
Full Member
Today's Friend is tomorrows foe.
Posts: 190
|
Post by epikhbk1 on Apr 12, 2012 11:52:30 GMT -5
just play with it and figure it out
|
|
|
Post by chaosshadic456 on Apr 12, 2012 12:11:45 GMT -5
first, you have to put the keyframes of the animation you want to put as homing attack in GAME_RESOURCES MODELS.bb. e.g.: ; ---- Meshes ---- Global Mesh_Sonic = LoadAnimMesh("Characters/Sonic/Sonic.b3d") RecursiveExtractAnimSeq(Mesh_Sonic, 0, 160) ; Idle RecursiveExtractAnimSeq(Mesh_Sonic, 533, 613) ; Walking RecursiveExtractAnimSeq(Mesh_Sonic, 695, 775) ; Joging RecursiveExtractAnimSeq(Mesh_Sonic, 852, 931) ; Running Homing RecursiveExtractAnimSeq(Mesh_Sonic, 1222, 1241) ; but this keyframes is from my model xd. now save the changes. second, Now go to PLAYER.bb and you have to put HOMING ATTACK action as shown in this example: ; Action constants Const ACTION_COMMON = 0 Const ACTION_JUMP = 1 Const ACTION_CROUCH = 2 Const ACTION_SPINDASH = 3 "-----Const ACTION_HOMING = 4-------------" save the changes and now the next step: go to PLAYER.bb and change: Case ACTION_JUMP p\Animation\Animation = 3 Case ACTION_CROUCH p\Animation\Animation = 1 Case ACTION_SPINDASH p\Animation\Animation = 1 Case ACTION_HOMING p\Animation\Animation = 4 Case ACTION_BOOST End Select and put this down: ; If the animation changed, animate new If (p\Animation\Animation<>p\Animation\PreviousAnimation) Then Select p\Animation\Animation Case 0 RecursiveAnimate(p\Objects\Mesh, 1, 1.5, 1, 8) Case 1 RecursiveAnimate(p\Objects\Mesh, 1, 4.0, 2, 8) p\Animation\Time# = 0.0 Case 2 RecursiveAnimate(p\Objects\Mesh, 1, 2.0, 3, 9) p\Animation\Time# = 0.0 Case 3 RecursiveAnimate(p\Objects\Mesh, 1, 3.0, 2, 8) p\Animation\Time# = 0.0 Case 4 RecursiveAnimate(p\Objects\Mesh, 1, 3.9, 4, 8) End Select save changes and the next step. go to PLAYER_MANAGEMENT.bb and agree: ; ========================================================================================================= ; Player_Action_Homing ; ========================================================================================================= Function Player_Action_Homing(p.tPlayer, d.tDeltaTime) If (p\Motion\Ground = True) then EndIf ; Land If (p\Motion\Ground = True) Then p\Action = ACTION_COMMON : HideEntity p\Objects\Mesh_JumpBall End Function and "PRESTO" you have a perfect homing attack. if you have any problem, just tell me .
|
|
|
Post by zankuujinmujinsho on Apr 12, 2012 14:44:58 GMT -5
^ This is irrelevant.
|
|
|
Post by chaosshadic456 on Apr 12, 2012 14:49:12 GMT -5
|
|
epikhbk1
Full Member
Today's Friend is tomorrows foe.
Posts: 190
|
Post by epikhbk1 on Apr 12, 2012 15:03:04 GMT -5
bro this homing attack dont work i coded my own
|
|
|
Post by chaosshadic456 on Apr 12, 2012 15:10:32 GMT -5
bro this homing attack dont work i coded my own watch it again, it I have changed.
|
|
epikhbk1
Full Member
Today's Friend is tomorrows foe.
Posts: 190
|
Post by epikhbk1 on Apr 12, 2012 15:35:21 GMT -5
i already made a new one...
|
|