UnderwareDESIGN

PlayBASIC => Beginners => Topic started by: ScottieBro1 on January 06, 2024, 04:48:35 PM

Title: Merry Christmas & Happy New Year!
Post by: ScottieBro1 on January 06, 2024, 04:48:35 PM
Free gift from the holidays!
God Bless Us One And All!

Here is another endless runner!

It could use some graphics and effects if anyone could help.

Originally it is top down view so a smiley face 3d rolling ball sprites would be kewl.
The wall again could be bricks top down walls. but any artwork would be nice to see.


A titlescreen and end screen as well if anyone care to build this better.

ScottieB
Title: Re: Merry Christmas & Happy New Year!
Post by: stevmjon on January 07, 2024, 08:01:54 PM
merry xmas and a better new year to all.

thanks scott for the gifts. you seem to always be busy working on something or another. i always look forward to seeing what you code.
you seem to code a good variety of programs too.

all the best for 2024 and beyond.

   stevmjon
Title: Re: Merry Christmas & Happy New Year!
Post by: kevin on January 07, 2024, 09:15:32 PM
 Good job...  Scotty and Happy New Year to you also
 



PlayBASIC Source Code Snippet - Ball Following Mouse - (2024-01-09)

  in this example PlayBASIC source code, we create a ball that moves towards the mouse with what seems like some soft acceleration.  The code also includes method to decouple the programs execution speed from the performance from the machine running the code.   This is achieved by monitoring the how much time has past between updates and only moving the characters when enough time has past.   If too much time has past we step the movement as per the required number of frames past.  


 [pbcode]

   PlayerX# = GetScreenWidth()/2
   PlayerY# = GetScreenHeight()
   
   //  Frame rate we're targeting
   TicksPerFrame# = 1000.0/100

   //  Current frame we're on
   CurrentFRAME    = 0

   // Time when this program Starts
   FrameStart       = timer()
   do

      // Check how much time as Past since program started
      TimePast#=(timer()-FrameStart)

      //  Is it time to move characters or not ??
      if (CurrentFRAME*TicksPerFrame#)<TimePAST#
   
         //  See how much time as past since we might need to move
         //  things more than once this refresh.
         FramesPAST = ( TimePAST# - (CurrentFRAME*TicksPerFrame#) ) / TicksPerFrame#

         //  Move everything
         for FrameCOUNT =1 to FramesPAST
            gosub Update_Logic
            CurrentFRAME++         
         next
      endif

      
      //  Scroll Wheeel to force a frame rate (simulate slower computers)
      LImitedFPS=cliprange(LimitedFPS+mousemovez(),0,1000)
      if GetFps()<>LImitedFPS
          Setfps LImitedFPS
      endif
      

      //  Draw the scene
      cls
      print "Machine FPS:"+str$(LImitedFPS)   

       circle PlayerX#,PlayerY#,30,true
      sync


   loop




Update_Logic:

       mX#=mousex()
       mY#=mousey()
   
       PlayerX# = curvevalue( mX#,PlayerX#, 20)
       PlayerY# = curvevalue( mY#,PlayerY#, 20)
   return


 [/pbcode]


 


Title: Re: Merry Christmas & Happy New Year!
Post by: stevmjon on January 08, 2024, 07:35:44 AM
just for fun i made all the graphics from inside PB.

also modified the re-dim arrays to only use re-dim when increase in size. no need to re-dim each frame when the array size has not changed.

have fun, stevmjon
Title: Re: Merry Christmas & Happy New Year!
Post by: kevin on January 08, 2024, 08:52:54 PM

  Steve,

     nicely done with the coins and brick work !