Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Game Library Sneak Peek
#1
Over the past few months I have been updating my libraries and making improvements. While doing this I also decided to update that old Sprite Library I created back in 2012. However, instead of just focusing on sprites it now focuses on game creation in general. By organizing my libraries (thank you for $INCLUDEONCE !) I've been able to really make some headway with this new library. I compiled a list of functions and subroutines I have completed and was a bit shocked at what I have finished so far.

Here's a sneak peek at the commands I've finished so far. I still have a ways to go (bugs, a few more commands, documentation, testing, example programs).

Code: (Select All)
'FUNCTION SOUND__NextIndex% ()                                                - get the next available index in the sound database
'FUNCTION SOUND_Make% (FileName AS STRING, Mode AS INTEGER, Volume AS SINGLE) - loads a sound from a sound file
'FUNCTION SOUND_Exists% (hSnd AS INTEGER)                                    - returns the existence of a sound in the sound database
'    SUB SOUND_Volume (hSnd AS INTEGER, Volume AS SINGLE)                    - set the volume level of a sound
'FUNCTION SOUND_Volume! (hSnd AS INTEGER)                                    - get the volume level of a sound
'    SUB SOUND_Delete (hSnd AS INTEGER)                                      - remove a sound from RAM and the sound database
'    SUB SOUND_Play (hSnd AS INTEGER)                                        - play a sound from the sound database
'    SUB SOUND_Stop (hSnd AS INTEGER)                                        - stop one or all sounds from playing
'    SUB SOUND_Pause (hSnd AS INTEGER)                                      - pause one or all sounds from playing
'    SUB SOUND_Resume (hSnd AS INTEGER)                                      - resume playing one or all paused sounds
'FUNCTION SOUND_Paused% (hSnd AS INTEGER)                                    - returns if a sound is paused
'FUNCTION SOUND_Playing% (hSnd AS INTEGER)                                    - returns if a sound is playing
'    SUB SOUND_PlayMode (hSnd AS INTEGER, Mode AS INTEGER)                  - sets a sound's play mode
'FUNCTION SOUND_PlayMode% (hSnd AS INTEGER)                                  - returns a sound's play mode

'FUNCTION SHEET__NextIndex% ()                                                - get the next available index in the sprite sheet database
'FUNCTION SHEET_Exists% (hSht AS INTEGER)                                    - returns the existence of a sprite sheet in the sprite sheet database
'FUNCTION SHEET_Load% (Filename AS STRING, GridWidth AS INTEGER, GridHeight AS INTEGER) - load a sprite sheet into the sprite sheet database
'    SUB SHEET_Delete (hSht AS INTEGER)                                      - removes a sprite sheet from RAM and the sprite sheet database
'FUNCTION SHEET_ClearColor~& (hSht AS INTEGER)                                - returns the transparent color of a sprite sheet
'    SUB SHEET_ClearColor (hSht AS INTEGER, cColor AS _UNSIGNED LONG)        - sets the transparent color of a sprite sheet
'    SUB SHEET_GridSize (hSht AS INTEGER, GridWidth AS INTEGER, GridHeight AS INTEGER) - define a sprite sheet's grid cell dimensions
'FUNCTION SHEET_Width% (hSht AS INTEGER)                                      - returns the width of a sprite sheet
'FUNCTION SHEET_Height% (hSht AS INTEGER)                                    - returns the height of a sprite sheet
'FUNCTION SHEET_GridWidth% (hSht AS INTEGER)                                  - returns the width of the grid cells on a sprite sheet
'FUNCTION SHEET_GridHeight% (hSht AS INTEGER)                                - returns the height of the grid cells on a sprite sheet

'FUNCTION IMAGE__NextIndex% ()                                                - get the next available index in the image database
'FUNCTION IMAGE_Exists% (hImg AS INTEGER)                                    - returns the existence of an image in the image database
'FUNCTION IMAGE_Make% (hSht AS INTEGER, Column AS INTEGER, Row AS INTEGER)    - creates a still image from an individual sprite on a sprite sheet
'FUNCTION IMAGE_Load% (FileName AS STRING)                                    - creates a still image from an image file
'    SUB IMAGE_Delete (hImg AS INTEGER)                                      - remove an image from RAM and the image database
'    SUB IMAGE_ClearColor (hImg AS INTEGER, cColor AS _UNSIGNED LONG)        - sets the transparent color of an image
'FUNCTION IMAGE_ClearColor~& (hImg AS INTEGER)                                - returns the transparent color of an image
'    SUB IMAGE_Restore (hImg AS INTEGER)                                    - restores the working image to the original image
'    SUB IMAGE_Flip (hImg AS INTEGER, Flip AS INTEGER)                      - flips the working image horizontally, vertically, or both
'    SUB IMAGE_Zoom (hImg AS INTEGER, Zoom AS SINGLE)                        - zooms the working image
'    SUB IMAGE_Rotate (hImg AS INTEGER, Degree AS SINGLE)                    - rotates the working image
'    SUB IMAGE_Put (hImg AS INTEGER, x AS INTEGER, y AS INTEGER)            - draws the working image to the screen
'FUNCTION IMAGE_Width% (hImg AS INTEGER)                                      - returns the width of the working image
'FUNCTION IMAGE_Height% (hImg AS INTEGER)                                    - returns the height of the working image
'    SUB IMAGE_Brightness (hImg AS INTEGER, Level AS SINGLE)                - change the brightness level of an image
'    SUB IMAGE_Contrast (hImg AS INTEGER, Level AS SINGLE)                  - change the contrast level of an image
'    SUB IMAGE_Gamma (hImg AS INTEGER, Level AS SINGLE)                      - change the gamma level of an image
'    SUB IMAGE_Negative (hImg AS INTEGER)                                    - convert the image to a negative
'    SUB IMAGE_GrayScale (hImg AS INTEGER)                                  - convert the image to gray scale
'    SUB IMAGE_Blur (hImg AS INTEGER, Level AS INTEGER)                      - perform a gaussian blur on the image
'    SUB IMAGE_Filter (hImg AS INTEGER, Filter AS INTEGER)                  - apply a predefined filter to an image

'FUNCTION CLIP__NextIndex% ()                                                - get the next available index in the animation clip database
'FUNCTION CLIP_Exists% (hClp AS INTEGER)                                      - returns the existence of an animation clip in the clip database
'FUNCTION CLIP_Make% (hSht AS INTEGER, c AS INTEGER, r AS INTEGER, Cells AS INTEGER, Dir AS INTEGER, Mode AS INTEGER, FPS AS INTEGER) ' make clip
'FUNCTION CLIP_Load% (FileName AS STRING, cw AS INTEGER, Dir AS INTEGER, Mode AS INTEGER, FPS AS INTEGER) - load animation clip from image file
'    SUB CLIP_Delete (hClp AS INTEGER)                                      - remove animation clip from RAM and the animation clip database
'    SUB CLIP_ClearColor (hClp AS INTEGER, cColor AS _UNSIGNED LONG)        - set the transparent color of an animation clip
'FUNCTION CLIP_ClearColor~& (hClp AS INTEGER)                                - returns the transparent color of an animation clip
'FUNCTION CLIP_CellWidth% (hClp AS INTEGER)                                  - returns the width of each animation cell within an animation clip
'FUNCTION CLIP_CellHeight% (hClp AS INTEGER)                                  - returns the height of each animation cell within an animation clip
'    SUB CLIP_FPS (hClp AS INTEGER, FPS AS INTEGER)                          - sets the frames per second rate of an animation clip
'FUNCTION CLIP_FPS% (hClp AS INTEGER)                                        - returns the frames per second rate of an animation clip
'    SUB CLIP_Direction (hClp AS INTEGER, Dir AS INTEGER)                    - set the play direction of an animation clip
'FUNCTION CLIP_Direction% (hClp AS INTEGER)                                  - return the play direction of an animation clip
'    SUB CLIP_PlayMode (hClp AS INTEGER, Mode AS INTEGER)                    - set the animation clip play back mode
'FUNCTION CLIP_PlayMode% (hClp AS INTEGER)                                    - returns the animation clip play back mode
'    SUB CLIP_SoundApply (hClp AS INTEGER, hSnd AS INTEGER)                  - apply an associated sound to an animation clip
'    SUB CLIP_Restore (hClp AS INTEGER)                                      - restore the working film strip to the original film strip
'    SUB CLIP_Brightness (hClp AS INTEGER, Level AS SINGLE)                  - change the brightness level of an animation clip
'    SUB CLIP_Blur (hClp AS INTEGER, Level AS INTEGER)                      - perform a gaussian blur on the animation clip
'    SUB CLIP_Contrast (hClp AS INTEGER, Level AS SINGLE)                    - change the contrast level of an animation clip
'    SUB CLIP_Filter (hClp AS INTEGER, Filter AS INTEGER)                    - apply a predefined filter to an animation clip
'    SUB CLIP_Gamma (hClp AS INTEGER, Level AS SINGLE)                      - change the gamma level of an animation clip
'    SUB CLIP_GrayScale (hClp AS INTEGER)                                    - convert the animation clip to gray scale
'    SUB CLIP_Negative (hClp AS INTEGER)                                    - convert the animation clip to a negative

'FUNCTION SPRITE__NextIndex% ()                                              - get the next available index in the sprite database
'FUNCTION SPRITE_Exists% (hSpr AS INTEGER)                                    - returns the existence of a sprite in the sprite database
'    SUB SPRITE_Reset (hSpr AS INTEGER)                                      - resets a sprite's settings to defaults and removes associated image
'FUNCTION SPRITE_Make% ()                                                    - creates a new sprite ready to configure
'    SUB SPRITE_Delete (hSpr AS INTEGER)                                    - removes a sprite from RAM and the sprite database
'    SUB SPRITE_ImageApply (hSpr AS INTEGER, hImg AS INTEGER)                - applies an image to a sprite
'    SUB SPRITE_ClipApply (hSpr AS INTEGER, hClp AS INTEGER)                - applies an animation clip to a sprite
'    SUB SPRITE_Justify (hSpr AS INTEGER, Justify AS INTEGER)                - sets a sprite's display justification
'FUNCTION SPRITE_Justify% (hSpr AS INTEGER)                                  - returns a sprite's display justification setting
'    SUB SPRITE_Xoffset (hSpr AS INTEGER, xoffset AS INTEGER)                - set a custom x coordinate display justification offset
'    SUB SPRITE_Yoffset (hSpr AS INTEGER, yoffset AS INTEGER)                - set a custom y coordinate display justification offset
'    SUB SPRITE_Mode (hSpr AS INTEGER, Mode AS INTEGER)                      - set the sprite to still image or animation modes
'FUNCTION SPRITE_Mode% (hSpr AS INTEGER)                                      - returns the still image or animation mode of a sprite
'FUNCTION SPRITE_ClipExists% (hSpr AS INTEGER)                                - returns if an animation clip has been applied to a sprite
'    SUB SPRITE_ClipRemove (hSpr AS INTEGER)                                - remove an animation clip from a sprite and set mode to still image
'    SUB SPRITE_ImageChange (hSpr AS INTEGER, Change AS INTEGER)            - allow changes made in the image database to affect sprite images
'    SUB SPRITE_Flip (hSpr AS INTEGER, Flip AS INTEGER) '                    - flips a sprite horizontally, vertically, or both
'FUNCTION SPRITE_Flip% (hSpr AS INTEGER)                                      - returns a sprite's flipped orientation
'    SUB SPRITE_Zoom (hSpr AS INTEGER, Percent AS INTEGER)                  - zooms a sprite
'FUNCTION SPRITE_Zoom% (hSpr AS INTEGER)                                      - returns a sprite's zoom level
'    SUB SPRITE_Rotate (hSpr AS INTEGER, Degree AS SINGLE)                  - rotates a sprite from 0 to 359.999 degrees
'FUNCTION SPRITE_Rotate! (hSpr AS INTEGER)                                    - returns a sprite's rotation degree angle
'    SUB SPRITE_RotateTowardSprite (hSprFrom AS INTEGER, hSprTo AS INTEGER, Offset AS SINGLE) - rotates a sprite toward aother sprite
'    SUB SPRITE_RotateTowardPoint (hSpr AS INTEGER, x AS INTEGER, y AS INTEGER, Offset AS SINGLE) - rotates a sprite toward an x,y point
'FUNCTION SPRITE_VectorX! (hSpr AS INTEGER)                                  - returns a sprite's normalized x vector quantity
'FUNCTION SPRITE_VectorY! (hSpr AS INTEGER)                                  - returns a sprite's normalized y vector quantity
'    SUB SPRITE_Move (hSpr AS INTEGER)                                      - move a sprite in the direction of the degree angle set
'    SUB SPRITE_Draw (hSpr AS INTEGER)                                      - draw the sprite to the screen
'    SUB SPRITE_Put (hSpr AS INTEGER, x AS SINGLE, y AS SINGLE)              - moves a sprite to an x,y coordinate location
'    SUB SPRITE_PutX (hSpr AS INTEGER, x AS SINGLE)                          - moves a sprite to an x coordinate location
'    SUB SPRITE_PutY (hSpr AS INTEGER, y AS SINGLE)                          - moves a sprite to a y coordinate location
'FUNCTION SPRITE_X! (hSpr AS INTEGER)                                        - returns a sprite's x coordinate location
'FUNCTION SPRITE_Y! (hSpr AS INTEGER)                                        - returns a sprite's y coordinate location
'    SUB SPRITE_Area (hSpr AS INTEGER, x1 AS INTEGER, y1 AS INTEGER, x2 AS INTEGER, y2 AS INTEGER) ' returns the justified rectangular area of sprite
'    SUB SPRITE__ResetCollision (hSpr AS INTEGER)                            - resets a sprite's collision detection variables
'FUNCTION SPRITE_RectCollide% (hSpr1 AS INTEGER, hSpr2 AS INTEGER)            - returns a rectangular collision between two sprites
'FUNCTION SPRITE_CircCollide% (hSpr1 AS INTEGER, hSpr2 AS INTEGER)            - returns a circular collision between two sprites
'FUNCTION SPRITE_CircRectCollide% (hSpr1 AS INTEGER, hSpr2 AS INTEGER)        - returns rectangular and circular collision between two sprites
'FUNCTION SPRITE_PixelCollide% (hSpr1 AS INTEGER, hSpr2 AS INTEGER)          - returns a pixel perfect collision between two sprites
'FUNCTION SPRITE_Collide% (hSpr1 AS INTEGER, hSpr2 AS INTEGER)                - automated collision check between two sprites
'FUNCTION SPRITE_CollidedWith% (hSpr AS INTEGER)                              - returns the sprite that this sprite collided with
'FUNCTION SPRITE_Collision% (hSpr AS INTEGER)                                - returns if a sprite has been in a collision
'    SUB SPRITE_CollisionArea (hSpr AS INTEGER, x1 AS SINGLE, y1 AS SINGLE, x2 AS SINGLE, y2 AS SINGLE) ' returns rectangular area of a collision
'    SUB SPRITE_CollisionPoint (hSpr AS INTEGER, x AS SINGLE, y AS SINGLE)  - returns the x,y point of a collision
'FUNCTION SPRITE_Distance! (hSpr1 AS INTEGER, hSpr2 AS INTEGER)              - returns the distance between two sprites
'FUNCTION SPRITE_DistanceToPoint! (hSpr AS INTEGER, x AS INTEGER, y AS INTEGER) - returns the distance between a sprite and x,y coordinate point
'FUNCTION SPRITE_DistancePointToPoint! (x1 AS SINGLE, y1 AS SINGLE, x2 AS SINGLE, y2 AS SINGLE) ' returns the distance between two x,y coordinates
'FUNCTION SPRITE_Seconds& ()                                                  - returns the number of seconds that FPS limiting has been active
'    SUB SPRITE_SpeedX (hSpr AS INTEGER, Speed AS SINGLE)                    - sets a sprite's x vector magnitude
'FUNCTION SPRITE_SpeedX! (hSpr AS INTEGER)                                    - returns a sprite's x vector magnitude
'    SUB SPRITE_SpeedY (hSpr AS INTEGER, Speed AS SINGLE)                    - sets a sprite's y vector magnitude
'FUNCTION SPRITE_SpeedY! (hSpr AS INTEGER)                                    - returns a sprite's y vector magnitude
'    SUB SPRITE_Reverse (hSpr AS INTEGER)                                    - reverse a sprite's direction by 180 degrees
'    SUB SPRITE_ReverseX (hSpr AS INTEGER)                                  - reverse a sprite's x vector direction
'    SUB SPRITE_ReverseY (hSpr AS INTEGER)                                  - reverse a sprite's y vector direction
'    SUB SPRITE_Status (hSpr AS INTEGER, Status AS INTEGER)                  - set a sprite's status (ignore, normal, pause)
'FUNCTION SPRITE_Status% (hSpr AS INTEGER)                                    - returns a sprite's status (ignore, normal, pause)
'    SUB SPRITE_Visible (hSpr AS INTEGER, Flag AS INTEGER)                  - set a sprite's on-screen visibility
'FUNCTION SPRITE_Visible% (hSpr AS INTEGER)                                  - return a sprite's on-screen visibility
'    SUB SPRITE_GlobalFPS (GlobalFPS AS INTEGER)                            - set the global frames per second rate
'FUNCTION SPRITE_GlobalFPS% ()                                                - return the global frames per second rate
'    SUB SPRITE_ResetFPS ()                                                  - reset the global frame and second counter
'    SUB SPRITE_LimitFPS ()                                                  - limit a loop to the global frames per second rate
'FUNCTION SPRITE_GlobalFrame% ()                                              - return the current global frame number
'    SUB SPRITE_ClipReset (hSpr AS INTEGER)                                  - reset a sprite's animation clip to default settings
'FUNCTION SPRITE_ClipNext% (hSpr AS INTEGER)                                  - advance to the next cell in the animation clip film strip
'    SUB SPRITE_ClipDirection (hspr AS INTEGER, Dir AS INTEGER)              - set a sprite's animation clip play direction
'FUNCTION SPRITE_ClipDirection% (hSpr AS INTEGER)                            - return a sprite's animation clip play direction
'    SUB SPRITE_ClipFPS (hSpr AS INTEGER, fps AS INTEGER)                    - set a sprite's animation clip frames per second rate
'FUNCTION SPRITE_ClipFPS% (hSpr AS INTEGER)                                  - return a sprite's animation clip frames per second rate
'    SUB SPRITE_ClipPlayMode (hSpr AS INTEGER, Mode AS INTEGER)              - set a sprite's animation clip play mode (once, loop)
'FUNCTION SPRITE_ClipPlayMode% (hSpr AS INTEGER)                              - return a sprite's animation clip play mode (once, loop)
'FUNCTION SPRITE_ClipFrame% (hSpr AS INTEGER)                                - return the frame number of a sprite's animation clip
'FUNCTION SPRITE_ClipCell% (hSpr AS INTEGER)                                  - return a sprite's current animation clip film strip cell in use
'FUNCTION SPRITE_ClipCellWidth% (hSpr AS INTEGER)                            - return a sprite's animation clip film strip cell width
'FUNCTION SPRITE_ClipCellHeight% (hSpr AS INTEGER)                            - return a sprite's animation clip film strip cell height
'    SUB SPRITE_Display ()                                                  - automated updating of all sprite characteristics and drawing
'    SUB SPRITE__Error (SubFunc AS STRING, Report AS STRING)                - report all errors found to programmer
New to QB64pe? Visit the QB64 tutorial to get started.
QB64 Tutorial
Reply


Messages In This Thread
Game Library Sneak Peek - by TerryRitchie - 08-10-2024, 06:42 PM
RE: Game Library Sneak Peek - by Pete - 08-10-2024, 06:56 PM
RE: Game Library Sneak Peek - by TerryRitchie - 08-10-2024, 07:01 PM
RE: Game Library Sneak Peek - by Pete - 08-10-2024, 07:25 PM
RE: Game Library Sneak Peek - by TerryRitchie - 08-19-2024, 04:07 PM
RE: Game Library Sneak Peek - by SpriggsySpriggs - 08-19-2024, 05:34 PM
RE: Game Library Sneak Peek - by TerryRitchie - 08-19-2024, 06:49 PM
RE: Game Library Sneak Peek - by NakedApe - 08-19-2024, 07:35 PM



Users browsing this thread: 6 Guest(s)