SideScroller - Small Basic Featured Program
Last month's challenges had vertical scrollers and so this month I suggested a platform type game.
Here is the challenge:
Game Challenge
- We have had the vertical scrolling game last month, so now it's the platform game. The challenge is to have some stationary platforms at varying heights that the player can move along (Left and Right) and jump (Space) up and down to. If the player falls too far (misses a platform) then they die.
- If you get the player jumping to platforms, then create a game out of it with some objective or scoring.
I was very impressed with Zock77's entry. This really is very good on many levels and budding game writers should have a look at how it all works.
- It has just 165 lines of well structured code, many of the lines are blank.
- It has a great 'hand drawn' animated man for moving and jumping.
- The keyboard control is very simple, smooth and reactive.
- The layout of the world can easily be changed for different levels.
The code comes with the images in a zip download.
Here is a snippet of the code showing a Subroutine that does the animated walking.
Sub ``WalkAni
`` Animationnum `` = `` Animationnum `` + `` 1
`` If `` Animationnum ``>`` = `` 4 ``Then
`` Animationnum `` = ``1
``EndIf
`` For `` i `` = `` 1 `` To ``3
``Shapes``.``HideShape``(``Walk``[``"R"``]``[``i``]``)
``Shapes``.``HideShape``(``Walk``[``"L"``]``[``i``]``)
``Shapes``.``HideShape``(``Walk``[``"SR"``]``[``i``]``)
``Shapes``.``HideShape``(``Walk``[``"SL"``]``[``i``]``)
``EndFor
`` If `` Standing `` = `` "False" ``Then
``Shapes``.``ShowShape``(``Walk``[``Direction``]``[``Animationnum``]``)
``Else
`` If `` StandAnimNum `` < `` 2 ``Then
`` StandAnimNum `` = `` StandAnimNum `` + ``1
``EndIf
``Shapes``.``ShowShape``(``Walk``[`` "S" `` + ``Direction``]``[``StandAnimNum``]``)
``EndIf
EndSub
As a game it is not fully finished, but this is a fantastic start and could be used as a template to develop further into a very accomplished game.
Already, another Small Basic enthusiast ProfessionalOfSmallBasic added a new level.
Comments
Anonymous
May 20, 2014
Very cool! But he doesn't have an animation for jumping yet?Anonymous
May 20, 2014
@Ed, yeah he does. And he animated the sprites without using an extension. Space bar to jump. Don't know where Zock got his sprites but it's really cool. You can draw your own sprites, scan them into a gif and use "Unfreeze" to make an animated gif as well. There's some creative stuff being posted on the forum that's for sure.Anonymous
May 26, 2014
I'd love to see people build off of Zock's game! I love the stick figure sprites!Anonymous
May 30, 2014
Finished game here... www.mediafire.com/.../SideScroller.zip