Coder Social home page Coder Social logo

silly-sam's Introduction

silly-sam

A game by Berd

Physics based silly movement joke toy thing.

Getting Started

On checking out the project there are two main folders. The 'silly-sam' folder contains all the game files as the Love2D project. 'map-editing' contains the Tiled files and the Silly Sam specific object instructions.

Things you'd need to download and learn

  • Love2D for the game creation framework
  • Tiled for creating the maps

Basics I'm using

  • Visual Studio Code
  • Git Bash

Controls

Joystick controls

If the corrisponding leg is on the ground, the left trigger puts a force up Sam's left leg and the right trigger puts a force up Sam's right leg. These should be alternated to make Sam shuffle around.

The left and right bumpers clench Sam's left and right hands respectively. If Sam's hand is overlapping something he'll grab that object untill the bumper is released.

The left and right sticks make Sam's arms point at the same angle you push the stick in. So if you push both sticks up Sam will hold their arms in the air.

Press start to pause.

Press back or right on the d-pad to toggle fullscreen. (Note you may have performance issues in fullscreen - if this occurs keeping the game windowed is recommended).

Press down on the d-pad to toggle music.

Keyboard controls

C lifts Sam's left leg if it's on the ground, N lifts Sam's right leg if it's on the ground.

E grabs with left hand, U grabs with right hand.

Use WASD to direct the left arm and IJKL to direct the right arm.

Press P to pause.

Use F to toggle fullscreen.

Use M to toggle music.

Branch labels

Each branch should be named with a prefix to explain what kind of content is in the branch.

  • feature/[name]. This is for a new feature, coding wise.
  • fix/[name]. This is for a bug fix or fixing a tech debt issue.
  • map/[name]. This is a PR focussed on making a new section of map or editing a map.
  • art/[name]. This is a branch for adding new art assets to the project. These branches should only be the addition of the art asset and a little code to implement it.

Projects we're using to make this (thanks so much for making these things!!)

Love2D Tiled

Simple-Tiled-Implementation: https://github.com/karai17/Simple-Tiled-Implementation

hump: https://github.com/vrld/hump

silly-sam's People

Contributors

benambrozevich avatar davidjtferguson avatar davidjtferguson37 avatar edward-naylor avatar rcsweeney avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

amleaver

silly-sam's Issues

googly-eyes, nose and mouth

just to give the eyes, nose and mouth their own limiting radius which they can spin/react in. to add some Xtr333me sillyness.

improve physics drawing

I've been drawing each physics object manually but just saw this tutorial for doing it all together

https://love2d.org/wiki/Tutorial:PhysicsDrawing

Should go through and try and apply. Need to look into if I can expand it to change colour for each shape or texture each object. Would be really nice to centralize object drawing if poss.

Object rotation descrepancy

In Tiled rotating objects happens around the lowwer left corner, however when put into the game STI rotates them around the top left corner.

rotation_discrepancy

Need to get STI to rotate around the same location as Tiled, or positioning rotated objects into levels correctly is going to be very difficult.

Animate backgrounds technique

Thinking of the best way to have backgrounds with a little movement.

One option is to have groups of bodies on a different 'layer' than the game layer then have some persistive force against them (say, wind force against trees) so they have constent movement.
A stretch goal of this idea would be to have sam 'influence' these objects as he moves past them.
Advantages: Would be consistent with the animation style of sam hiself and would create dynamic animation.
Disadvantages: Moves more work to code side, would be a fair bit of work to make a model in Tiled so people can create their own things iin the system. Too many bodies may start to invite slowdown, though I'm not sure where our boundries lie with this.

Other option is to have spritesheets for each of these things.
Advantages and disadvantages are basically opposite - would be implmementing a different animation style for a different layer which might be jaring (Although maybe the seperation of styles would be good for communicating to the user what is interactable or not?) and would move work to the art side instead of the code. Would be easier to put into the map.

Static backgrounds should be put in first before exploring these options I think.

Grabby Hands!

Once analogue-trigger-legs are in and we're happy with how they feel - can use LB and RB to make the hands grab! If too difficult codewise just gimmi a slap and leave it. But if simple, I think it could be hilarious to awkwardly jump and dangle off things by grabbing on to them. (think of a flying fox, moving platform, a lever you have to pull, a rope you have to pull to play tug-of-war, or being able to hold items).

how I imagine the logic working: radius around hands that's slightly larger than an open hand - and some objects are marked either grabbable and they stay stationary, or grabbable and they can be picked up. or I guess if it's all physics it would just depend on the weight of the object. don't need a magnet-hand system to snap the object close, a visual gap is totally fine I feel *in the case we grab on to something at the edge of the radius, and the closed hand sprite is smaller than this

face joints re-do

the face is funny, but gets broken easily. try and make it more stable - and the hair joke is funny but not when it refuses to go back. either make it easier to reset to neutral or lessen the limit

Store picture card for Itch.io

If you look at the itch.io front page, each game has an image associated with it to entice the player to try it out:
https://itch.io/

Need one of these for sam - preferably containing the logo discussed in issue #59 .

tiled loading for hanging bags

Now got basic hanging bags, need to be able to load them from tiled with the following flags:

xSpawn: x location for the 'anchor' object the bag is hanging from is
ySpawn: x location for the 'anchor' object the bag is hanging from is
ropeLength: distance between the spawn point and the actual bag
bagWidth: width of the bag
bagHeight: height of the bag
pivitingJoint: if true, add another joint between the bag and the end of the 'rope' so the bag rotates around the point where it meets the rope. Otherwise keep it as is where the bag rotates around the anchor

Camera detect edges of map and detach from player

Currently when the camera gets too close to the edge of the map the visible map and the actual physics objects get out of sync. Investigate and fix.
(Of course maps could just be 'boxed in' to prevent this but that'd be silly

Edit: I removed the code that locked the camera inside the bounds of the map in this commit:
c26a6f7
So the de-sync no longer occurs but the camera goes past the edge of the map. Once the camera detaching is put in this code should be re-instated to prevent the camera breaking over the edge of the map

Pause menu design/visual

Pause menu options are sketched out in #65 . Need some idea of the visual on how these things are going to be layed out. Something straight forward.

Collection of toys for sam to interact with

Collection of toy like objects for any situation for sam to interact with.

  • skateboard DONE
  • sportsballs (bowling ball, golf ball, tennis ball, football, rugby ball) DONE
  • shed (or other light structure for sam to crash through)
  • Other sam-like entities (childen, dancers, etc)
  • hanging punching bags DONE
  • standing punching bags

Eye grab bug

I grabbed Sam's eye with one of his hands and he freaked out - flying into the air and all bodies flicking around everywhere. Need to make face features not grabbable.

Allow full screen

Allow full screen, with all the correct scailing and taking different screen sizes into account that comes with that.

are you sure to quit? on closing

Just added pressing esc or back closes the game. I guess it's common practice for a 'are you sure?' message before just closing the window. Should probably make one?

Preportions of the world?

The size of sam in relation to the size of a tile in tiled wasn't a concious decision. Currently it's quite difficult to move up a single tile which leaves moving along a flat surface and moving downwards as the main movement directions. So I'm thinking the tiles should be a little smaller so it's not so much effort to get up a single tile. But the size of the tiles will dictate how the art looks, and smaller tiles means we need more detailed maps. Depending on the focus of our game - silly jokeness or some gameplay challenges - we need to play around with map dimentions so we can nail something down and start making tilesets.

Worth remembering hump has a camera zoom in and out functionality - so how much space on screen Sam currently takes up can easily be changed.

Get STI to recognise a camera zoom

Set up the CameraToStiTransforms to get the map to change correctly when zooming in or out so we can use the map zoom function freely.

Arm allowing to climb up walls?

Currently the game treats everything that isn't sam as something it can jump off or have the 'get up force' applied to.
This means it's possible to pin one of Sam's arms against a wall then get a strong force up the wall.
Part of me wants to take it out because it might be confusing but part of me wants to keep it because it's funny and suitably goofy.
Will need discussion.

If we decide only specific objects should be kick off and push off - able then will need to give everything a new flag and check the flag somehow. (time that could be spent elsewhere so will see how valuable this may be)

Logo

A Silly Sam logo to put in the sky for the first screen as the game starts, for some kind of 'intro' to welcome the player.

Similar to how Rolly welcomed the player with the Rolly logo flying in the air when first entering the hub.

use sti layer drawing properly

I don't want to draw the game objects that are brought in from tiled, I just want to create game objects based on that info. but eclipses and other objects draw with my current method. being cheeky and hiding them behind the background layer, but it's kinda confusing and silly. Should seperate out the object layers and not draw them.

face joints re-do

the face is funny, but gets broken easily. try and make it more stable - and the hair joke is funny but not when it refuses to go back. either make it easier to reset to neutral or lessen the limit

texture application for generic toys

Each toy will need to be textured. For the ball and the rectangle these are generic shapes that could be used for a variety of things. (the ball could be used for various sports balls or a massive boulder for example.) As such a map designer also needs to be able to change the texture in the map editor, and see what they're changing it to.

I'm thinking for the more specific objects like the skateboard and hanging bag they may all want to look the same, so only counting the most generic rectangle and ball in this task.

survival level

I wanna make a level like the original where there's 3 exploding platforms and you have to survive as long as possible.

pause menu options

Pause menu should have simple options.

  • restart level
  • quit game
  • unpause
  • (re-set game?)
  • (go to survival level?)

Should make escape stop closing the game once the pause -> quit option is in also

controls tweaking - arms upwards force

The arms upwards force to get up acts really strangly at the moment. It seems to have a random amount of energy, which should be straightened out.

It's also always active, which can be confusing when you're trying to drag yourself around then get this sudden push. Only if the stick is moved from nutural should this be activated.

scrolling sam textures

  • a global body texture used for sam's body parts.
  • being in different locations 'cuts out' a different part of a large 'global' texture.

need:

  • texture
  • CODE (u, v coords)

dynamic bodies confuse each onGround

a situation where say a ball rolls into Sam's leg, then rolls away, confuses the onGround logic because the 'non-sam's body' or 'ground' object disconnecting with Sam's leg (or any body part) triggers the onGround checking code and makes it think because the object is no longer touching sam's leg, Sam's leg must no longer be on the ground. Which, is obviously wrong if sam was standing on the ground and the ball rolled into him them rolled away.

in function GameState:bodyOnGround(body1, body2) need to check through all of the contacts on a sam's body part to make sure none of them are non-sam's body before setting onGround to false.

introduce explodingPlatform before survival area

Player needs to have an idea what the bursting platforms are before being thrown in the arena. Could add to start level, or have a wee area before the survival area where they see what the platforms are/do.

re-write gamestate:bodyOnGround

re-write using body:getUserData. Should set the user data for each body part to some identifier and then won't need the sam.allParts table or all the looping.

level transition weird frames bug

When the game loads a new level there's always like a frame of something random, normally like Sam's zoomed in face. Would be nice to smooth this out. Not sure how to approach it though. Don't draw for a frame or two? with a 'loading' icon? .... uuk.

ramps

Would be nice to have ramp objects for sam to slide up or down.

First need to be able to read a series of points from the map editor.

Thinking using some kind of smoothness algorithm (bezier curves or the other one... damn I want my maths book!) then using those points out into a curve.

Using those smoothed points to make a long shape chain object.

Controls tweaking - arm inputs for keyboard and mouse

We want people to play the game with an xbox controller but not everyone will have one handy, so the game needs to be playable with keyboard. Already got F and J on the left and right legs. Arms are more difficult since they're analogue. Could have WASD point the left arm in each direction, and OKL; point the right arm in each direction. that's the simplest I can come up with so should be done unless a better aproach is drempt up.

replace credits with team name

Currently

  • in the top of the readme
  • in the top of main.lua
  • at the top of the license

The game is credited as 'Davbo' or 'Davbo and Rory~'

Since we have 4 of us working together now we need a team name and need to replace these instances with the team name. Our current thinking for the team name is 'Berd'.

some sprites not layering on background properly

Ever since removing the background tiles in tiled and letting the sprites just lay on the screen cleared colour the boarders to some sprites (clouds, tree tufts) have had a weird dark outline. Weirldy, trees don't have this (or at least it's not visible)

Could re-instate background layer, would be better to figure it out and fix it instead of having to draw extra stuff.

windows icon and title

Currently the icon in the top right corner is the love2d icon, and the title says 'Untitled'.

Can change the icon using

imageData = love.image.newImageData( "filename.png" )
success = love.window.setIcon( imageData )

Need a 32x32 image to become the windows icon.

and can change the title using

love.window.setTitle( "Silly Sam" )

give sam's arms a 'shadow' across his body

Since sam's shirt sleeves are the same colour as his shirt when they overlap his sleeves effectively become invisible.

It'd be cool if there was a slightly bigger, slightly darker version of the arm sprite around the arm that only became visible when it was overlapping with the shirt.

Should be easy to change the colour and draw the same sprite in the same place slightly bigger. The 'only appear if overlapping sam's shirt' effect can hopefully be done pretty easily using Love2D's stencil.

dynamic camera

Sam should have a 'dead space' in the centre of the screen where they can move without the camera following. Also thinking it'd be nice to use some of hump's camera smooth functionality to follow sam around smoothly, since it kinda matches the game's floppy demeanor. Maybe only need one of these or the other. Experimenting is part of the ticket.

Also want each object to be able to have a 'cameraFocus' bool and a 'cameraDistance' int.
The 'cameraFocus' bool tells the camera that the object is important and if it is within range the camera should move to make sure the object is in frame.
the 'cameraDistance' int will be the range that the object should be in view for.
Note that the camera will need to know how much to zoom out to make sure all important objects are in frame.

Diagram:
camera sketch

level changing

We're going to have a few different tiled levels that sam travels through. Need to have triggers that sam can hit that send him to a new level.

slightly flexable leg connections

Move sam's leg inputs to his triggers. Maybe play around with the idea of different depths of pull having different forces? Would need to have a system of detecting different depths of trigger pull with as little of a pause as possible. I'm thinking when you detect no change (or very little change) execute.

Hold down to charge as well then release. Wiggilly legs.

Holding trigger down could bring leg up, then releasing could stamp foot down. Gives good visual feedback & falling over before stamp would make aiming easier

sti cannot create canvas bug

after leaving sam running for a couple minutes had the crash described here:
https://love2d.org/forums/viewtopic.php?t=84144

... should make sure that doesn't happen. error:

Error

Simple-Tiled-Implementation/sti/init.lua:861: Cannot create Canvas: Texture format cannot be rendered to on this system.

Traceback

[C]: in function 'newCanvas'
Simple-Tiled-Implementation/sti/init.lua:861: in function 'resize'
hump/camera.lua:96: in function 'resizeMapForZoom'
hump/camera.lua:117: in function 'zoomTo'
hump/camera.lua:320: in function 'gamestateUpdate'
states/gameState.lua:212: in function 'update'
[C]: in function 'xpcall'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.