Coder Social home page Coder Social logo

fifty-bird's People

Contributors

coltonoscopy avatar dmalan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fifty-bird's Issues

Trouble in resizing the window

This is my code:
function love.load()
love.graphics.setDefaultFilter('nearest','nearest')
love.window.setTitle('FLAPPY BIRD')

push:setupScreen(virtual_width,virtual_height,window_width,window_height,{
	resizable=true,
	fullscreen=false,
	vsync=true,
	
})

end

function love:resize(w,h)
push:resize(w,h)
end

But I still keep getting the error:
Error

push.lua:270: attempt to perform arithmetic on local 'h' (a nil value)

Traceback

push.lua:270: in function 'resize'
main.lua:25: in function main.lua:24
[C]: in function 'xpcall'

Please somebody help

delta-time reconsideration in Bird Class

Hi @coltonoscopy

While going through the update function in Bird class, I saw that you have multiplied dt to GRAVITY while adding it to self.dy. And you are simply adding it to self.y to simulate the fall due to gravity. Which works as intended.

However, would it not make more sense to simply do self.dy = self.dy + GRAVITY and later do self.y = self.y + self.dy * dt. Which actually translates to displacement = speed * time?

This implementation has an added benefit in Bird-4 where you are simply adding -5 when space is pressed, which in turn is added to self.dy, without taking delta-time into consideration! This might cause severe lag / speed-up of the bird in some cases depending on the frame rate.

Also, if you want the GRAVITY to actually mean acceleration due to gravity you could do, self.dy = self.dy + GRAVITY * dt (speed = acceleration * time) and then self.y = self.y + self.dy * dt (displacement = speed * time). Which would make it technically more accurate!

Then, that would end-up being

function Bird:update(dt)
    -- apply gravity to velocity
    self.dy = self.dy + GRAVITY * dt

    -- add a sudden burst of negative gravity if we hit space
    if love.keyboard.wasPressed('space') then
        self.dy = -5
    end

    -- apply current velocity to Y position
    self.y = self.y + self.dy * dt
end

Pipe height undefined

I am getting an error that says this
Error

main.lua:51: attempt to perform arithmetic on global 'PIPE_HEIGHT' (a nil value)

Traceback

main.lua:51: in main chunk
[C]: in function 'require'
[C]: in function 'xpcall'
[C]: in function 'xpcall'

Fifty-bird project

When I try to run a program in the fifty-bird repo it doesn't work so what could by the problem

PipePair Generation Not Working

For bird8:
For some reason, even if I copy and paste the exact code provided here , the pipe generation still doesn't wanna work.
the game just keeps on going for eternity , just without the generation of pipes.
uptill bird 7 , all was working fine , but then bird8 ruined everything

Framerate Difficulty Problem

Hi, I'm not sure what's going on, but it seems that when I play my completed game on crappy systems, it's significantly easier because it seems like the bird doesn't jump as high or fall as fast. I'm assuming this is an issue with framerate and deltatime.

I noticed this while testing on a Dell Inspiron laptop. ( parents' computer )

I got scores higher than 30 several times, and only died because I made the bird fall to end the test. It really could have gone on indefinitely.

The narrowed "jump / fall range" makes it very easy to slip through small pipe gaps. Is it a known phenomenon for framerate to affect a game this way, or is this just all a fluke?

Is there a way to compensate for low framerates in the gravity code?

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.