I don’t care if there are run time errors during execution of code if you are just patient enough to explain what caused them and how to amend the code. We are all learning here and don’t expect perfection. In fact a person would learn the least if he succeeds in the first go.
@harshetmaruff2262 жыл бұрын
yes, bro u are true I failed more than a 1000 times in programming but i feel like i know most of the things than an IT Professional, because i am just 15 year old kids, the guys who came from the college was struggling to code as a fresher in companies, but i would write faster than them
@georgejaniec2 жыл бұрын
Truth has been said. Thanks!
@noahrodriguez18953 жыл бұрын
This guy is a gift to us. thank you harvard and teachers! The way you explain the material shows you have mastered. you are brilliant! I am forever grateful for these lectures!!
@imie-nazwisko3 жыл бұрын
At 1:32:50 The bird kept flying up then flew off screen while he wasn't focus. There was no overflow. The bird's velocity increased exponentially when it's falling down. So the bird was just falling down too fast.
@gregcruz65177 ай бұрын
isnt that what he is saying, that the velecoity is so large it overflowed to a negative so it couldn't be recovered even with spam space?
@imie-nazwisko7 ай бұрын
@@gregcruz6517 It's been two years so I apologize for any inaccuracy in advance. I guess what I meant to say two years ago was that he spam space and cause the bird to fly offscreen. Since we don't know its actual height at the time, we can assume it has reached quite a long distance from the original screen, giving it the illusion that the bird might not be falling at all. But it did fall. The gravity he implemented cause the bird to accelerate downward very fast without a limit. So if it reach 3 times the height of the screen it will fall 3 times as fast (Take this with a grain of salt, it depends on the code). On whether or not the velocity actually overflowed, Lua usually uses 64-bit (depending on how the program is compiled, it also can be 32 to 8 bit which is still a very large number) for integers so I find it quite hard to achieve that within a short time frame.
@krasp70096 ай бұрын
@@imie-nazwisko funny to see that u came back after 2 years :0
@kimjongun38902 жыл бұрын
all teachers are brilliant it is extremely hard to pick a favorite
@tribui18365 жыл бұрын
@ Colton found a small bug in the code: if you just jump flappy bird all the way up so that he is way over the top of the window, you can actually go pass the pipes (because your pipes have finite length) ;). Many ways to fix of course. I wrote an additional function to take care of this collision outside of frame case. Love the course so far!
@user-uh7lr6bo7w4 жыл бұрын
can you please help me with fixing this bug?
@nazarkhan14914 жыл бұрын
@@user-uh7lr6bo7w Just like in Pong, you use math.max(0, self.y + self.dy * dt) to prevent flappy bird from going over the top
@user-uh7lr6bo7w4 жыл бұрын
@@nazarkhan1491 thanks))
@elokthewizard2 ай бұрын
did not expect to see boundary break here!
@andybirder49704 ай бұрын
Gosh, I love this more then CS
@VishnuPanick4 жыл бұрын
This is beautiful.
@Jx_- Жыл бұрын
Was not expecting a Shesez cameo, but now that I think about it, it was only a matter of time
@elokthewizard2 ай бұрын
haha i just commented almost the same thing! Howdy from the future :)
@joesilva35193 жыл бұрын
aw man colton tries to ask questions to the class and none of them answer; makes me so sad seen as the questions he asks are reasonable and that he had taught them in the last lecture :(
@joesilva35193 жыл бұрын
ok nevermind i have made it later in the lecture now, ever since the guy came up to play the game - they answer his questions - great job colton i wouldnt have been able to win them over
@Mai_Tai_Meyers Жыл бұрын
@@joesilva3519 lol I had the same reaction. It seems like people got more and more comfortable with asking questions as the lecture went on.
@TheOnlyGhxst Жыл бұрын
To be fair, I just did the previous lecture the day before, and already forgot the exact answer to some of the questions. When people don't know the *exact* answer, they're less likely to risk being wrong by answering at all.
@ArtistNotFound1235 ай бұрын
Alright so I started this whole process, coding and all, about 2 weeks ago, and I’ve gotten the long game working with an ai and I’m checking out flappy birds in advance. Every topic is interesting to me.
@TheseusDaKing8 ай бұрын
if you are clearing the keyspressed table every frame wouldn't it be more efficient to just check whether the key exists in the table rather than assigning a boolean and checking the value of the key?
@dushyantDev992 жыл бұрын
Where to find game assets ?
@Another_me180811 ай бұрын
In Pipepair , can we just add two sprites , one is Pipe.png and the other is PipeReverse.png and then we can spawn them randomly without calculate gap height if we set condition pipe height for them so they will have gap each time spawned ? i think that is easier
@nesspyr10 ай бұрын
you can, but i think the goal by flipping the image is to save memory by only loading in one image
@sergiorodriguezmendoza55874 жыл бұрын
i have a problem when i trie what the pipes or an object appears in the screen using the table, i put if a > 2 then table.insert(name of table, name of class) end but in the moment of run the game the object appears in the screen and last 2 seconds that spawn again deleting of the screen the previous object what i can do?
@user-cl7sk9mc3w Жыл бұрын
how to get currentstate using gstatemachine ?? .. i was try to make pause state don't know how if keypressed escape and currentState == play then scrolling false how to change these to code ?? ..
@HassanMushtaq-rn5zeАй бұрын
Can someone eleborate on how he scroll the background, with modulus ? I mean why he takes modulus? what's the reason. eleborate please on whole scrolling method . Thanks
@dustinkilburn8791Ай бұрын
The fundamental idea is that, because the background is the same image twice, you can simply shift the background back to the right once it goes left far enough and make it appear like it is still in the same place. This allows us to create the visual illusion that the background scrolls forever. This works because the game actually updates a lot faster than our eyes can process, so we never see the transition. As for using the modulo operator, it is basically a short cut. You could just check to see if your image has scrolled past half of the image width and then subtract that amount to move it back, to do the exact same effect. Modulo returns the remainder of a long division. In this case, since we are dividing it by that half-way point, that remainder will be the amount we want to scroll the image anyway. Right up until it passes that half-way point which will then snap it back. Same outcome, but less code. I would say feel free to write the code in the way that makes the most sense for you now and worry about optimizations and brevity later when you feel more comfortable.
@shubhrojyotikabiraj83222 жыл бұрын
Really appreciate what you guys are doing. Love your lectures. I am facing difficulty in understanding this code sec in StateMachine function StateMachine:change(stateName, enterParams) assert(self.states[stateName]) self.current:exit() self.current = self.state[stateName]() self.current:enter(enterParams) end I am not able to understand it. Like i got we are trying to change from one state to another but i am not able to get how it is internally working.
@hombiebearcat2 жыл бұрын
Line by line: - assert(self.states[stateName]) - all this is doing is checking if the state exists in the list of possible states - self.current:exit() - calls the exit function of the current state being updated/rendered - self.current = self.state[stateName]() - creates a new instance of the state being switched to (and changes the current state to it so that the StateMachine's update/draw functions will update/render the correct state) - self.current:enter(enterParams) - calls the enter function of the new state The enter() and exit() functions here aren't used and don't do anything - they are there in case the programmer has implemented some kind of transition (e.g an animation that should be played) between states. Here, the exit() and enter() calls don't do anything - all the function is doing is setting the current state to the new state so that the new state is the one being updated and rendered. Hope that helped!
@TheOnlyGhxst Жыл бұрын
Does anyone know the timestamp where he makes the game pause?
@Gabbbs4 жыл бұрын
i tried to run bird 2 and got this error. Can anyone explain me what is going on please? Bird.lua:3: attempt to call global 'Class' (a nil value)
@joaquinhernandez99954 жыл бұрын
tal vez no esta el .lua "Class" en la carpeta del bird 2, por eso dice que es de valor nil, que significa vacio, o ninguno, a mi interpretacion
@Gabbbs4 жыл бұрын
@@joaquinhernandez9995 buenas! Ya lo solucione, había escrito Bird pero la clase se llamaba "bird"
@vasanthajayaraman98724 жыл бұрын
U have to add a class module and name it class.lua u can search class module in GitHub and paste it in ur code
@trekbeyblade2 жыл бұрын
What is the point of BaseState?
@AlguienSaquemeDeLatinoamerica8 ай бұрын
The Anti-Gravity Update section of the video was not entirely clear to me (as I post this comment, I haven't watched anything beyond minute 52:55). The main intention/objective of making the love.keyboard.keysPressed empty table, assigning it “true” as a value when a key is pressed, and then making a function that checks if any key was pressed in the last frame is, that in cases like have two different behaviors/functions and that both are activated with the same key, to prevent both from being executed simultaneously and generating unwanted behaviors or even errors? If not, what is the point of all that? Just write fewer lines in main.lua’s love.keypressed?
@shreyashgupta3776 жыл бұрын
Rather than creating a new function and table in the love.keyboard directory, I decided to create a new function in the Bird class called Bird:flap() which when called instantly sets the dy of the bird to a negative value (in my case, -6). Then in my main.lua file, under love.keypressed, I added a new if statement which checked whether the key pressed was space and if so, triggered the Bird:flap() function. Does this approach hurt the efficiency of execution or cause any problems?
@coltonoscopy6 жыл бұрын
Shreyash, that solution works fine for a small game like this, but if you have a larger code base with hundreds of different things that may potentially react to user input, putting them in `love.keypressed` is not sustainable, so the approach I offer here would be better! But sure, for a game like this that's totally fine!
@shreyashgupta3776 жыл бұрын
Understood. My thanks, sir
@DrPol13 жыл бұрын
Had the same question, thanks Colton for replying
@anilsonix4 жыл бұрын
Can someone explain the logic of procedural generation of Pipepairs
@rafaelcarvalho20404 жыл бұрын
why are we setting some variable local if we aren't going to use them in the other files? Is there a benefit to using local variables?
@joesilva35193 жыл бұрын
local variables actually mean that the variable is limited to use only in that file. we define it as local because lua automatically sets all variables to global, but if we have a very generic variable which we know will be unique to this file, we can define it as local to reduce our chances of accidentally calling a different variable in another file the same name. this would also be helpful when working with other programmers on a project, so different variables dont link to each other because they have the same name
@tmncx02 жыл бұрын
1:09:06 ヽ༼ຈل͜ຈ༽ノ RAISE YOUR DONGERS ヽ༼ຈل͜ຈ༽ノ
@DonYurik4 жыл бұрын
The build 6 confuses me a lot. There are some things regarding tables that I didnt get
@m3rlaut4 жыл бұрын
try to visualize what he's saying.
@RichardMitchell-nk9ec3 ай бұрын
Flappy bird its so easy to make
@picklebandit75884 жыл бұрын
how do you program a pause function?
@DonYurik4 жыл бұрын
You create a gameState='paused'. If gameState is not paused, you tell update to perform all of its functions.
@adityamishra24694 жыл бұрын
A gamestate and keypressed function is all that it takes
@qqq95422 жыл бұрын
What programming language is he using in this lecture?
@apilatosba23462 жыл бұрын
lua
@louis91164 жыл бұрын
took me 30 minutes to figure out that "__includes" has TWO underscores, not just 1 thank u, lua
@harshbadiwal65444 жыл бұрын
please tell me the name of application which has 3 dots on its title bar and how to download it
@Goyal_Sahabb4 жыл бұрын
For coding purposes using Microsoft visual studio code. and if you are looking for three dots with the red green and yellow colour it's the it's the Mac OS
@harshbadiwal65444 жыл бұрын
@@Goyal_Sahabb sir for Windows which application I have to download
@Goyal_Sahabb4 жыл бұрын
Microsoft VisualStudio Code. Also watch videos on how to Install extension of Love-2d In Visual Code. After installing the Vs Code
@not_amanullah5 ай бұрын
Thanks ❤
@tessiof3 жыл бұрын
1:38:18 1:41:20 What!?
@RS_Gaming_00004 жыл бұрын
lots of errors are coming with the files on the edx website please solve that sir please
@davidjmalan4 жыл бұрын
You'll need to be more specific!
@RS_Gaming_00004 жыл бұрын
the things are that this is being shown on screen after a run on screen Error lib/push.lua:101: attempt to call field 'getPixelScale' (a nil value) Traceback lib/push.lua:101: in function 'initValues' lib/push.lua:48: in function 'setupScreen' main.lua:74: in function 'load' [C]: in function 'xpcall' [C]: in function 'xpcall' sir this is in all files for love2d
@roflc0pterable4 жыл бұрын
@@RS_Gaming_0000 getPixelScale has been replaced with getDPIScale in the current version of LOVE2D In push.lua you'll want to replace any love.window.getPixelScale() with love.window.getDPIScale() That should fix the errors
@aashrithmadagiri67114 жыл бұрын
@@roflc0pterable Thank you
@RS_Gaming_00004 жыл бұрын
@@roflc0pterable thank you for the code.
@HungTran-nf7rb5 жыл бұрын
Can anyone explain why i use pipePair code couldn't run? table.insert(self.pipePair,PipePair(y))
@jconrace3 жыл бұрын
Does anybody have the sourcecode? The files I found on GitHub for GD50 are all very different from the files he's using here and none of them work.
@badihaboulhosn81782 жыл бұрын
yea me too, i didnt find the source code for the pong game
@jconrace2 жыл бұрын
@@badihaboulhosn8178 for what it's worth I never found the source code that worked. I keep thinking that puzzling through everything helped me learn but 5 months later I'm still really clueless and my flappybird clone barely works.
@Grunchy0054 жыл бұрын
Holy cow it has been many many years since the last time I encountered someone who drools so much.
@RichardMitchell-nk9ec3 ай бұрын
Can make flappy bird in like an hour
@gamersmaycry52044 жыл бұрын
I have a problem with update 9, bird wont fall nor jump it just keep flying horizontally, it seems that the bird:update function is not working. Could the problem be that im using love 11.3?
@jot4te4634 жыл бұрын
hello, you have no problems starting the game? I can not because it tells me that the push does not exist or something like that. please helppp
@shikhargautam92124 жыл бұрын
i mistakenly pushed both assignment0 and assignment1 to the same branch of me50 at github now i am neither able to delete the file nor the branch can anyone help ???? i am a beginner to github
@trekbeyblade2 жыл бұрын
Can someone explain to me what does this function do in the PipePair Update math.max(-PIPE_HEIGHT + 10, math.min(lastY + math.random(-20,20), VIRTUAL_HEIGHT -90 - PIPE_HEIGHT)) it's really confusing.. T_T
@MrThinhle2 жыл бұрын
Yeah me too =((
@rahulmittal90232 жыл бұрын
This code is just shifting the new pair's vertical position from the last pair's position by a random number between (-20,20) while restricting the new pair's vertical position within the virtual height of screen.
@ahmetozdemir1716 Жыл бұрын
Harika🎉
@rpgsoul15376 жыл бұрын
Hi. Mr Colton can you explain this state machine thing a little bit more? I dont get this: gStateMachine = StateMachine{ ['title'] = function() return TitleScreenState() end, ['play'] = function() return PlayState() end } So, basicly what is happening there? You create an object of class StateMachine named gStateMachine but why there is a table {} and not () if it is a constructor? And which function it invokes with "function()"? Thank you in advance.
@mrkdji63906 жыл бұрын
1) lua lets you omit () if the only argument of a function is one table 2) he doesn't invoke any function, he is defining one (lua lets you define function almost everywhere)
@rpgsoul15376 жыл бұрын
Thank you man, so this is just working like a block of code. ['title'] is itself a function. Now i get it. Thanks.
@tessiof3 жыл бұрын
At 1:16:24 we subtract PIPE_HEIGHT because we will flip the sprite. But at 1:28:58 we add PIPE_HEIGHT on the flipped sprite, making the previous subtraction meaningless.
@GDAndres1998 Жыл бұрын
You are right! But later the collition logic should be changed because the upper pipe object (not the render) is still actually overlapping the lower one
@raps554 жыл бұрын
I am facing some kind of error with the push function. The error says: attempt to index global 'push' (a boolean value). Any way to fix this guys?
@capnjon68354 жыл бұрын
Have you changed getPixelScale() to getDPIScale()?
@xbananaheadx4 жыл бұрын
@@capnjon6835 hey, i'm still in the beginning of the video and i'm having the same problem. is that fix like later on in the video or is that something i could do now?
@capnjon68354 жыл бұрын
@@xbananaheadx Do it now and changed it at push.lua. it will be right there in the middle of the code
@capnjon68354 жыл бұрын
*change
@hunnygarg2774 жыл бұрын
Pls someone tell why we are learning through love 2D instead of unity
@DrPol13 жыл бұрын
Löve enables you to start up 2D projects very easily. Unity can be used for 2D as well but it's primarily a 3D development environment so doing simple 2D projects would not be as simple as doing them with löve. Unity also has an extensive and complex IDE which löve lacks so Colten can focus just on the code and basic logic (rather than explaining each of the buttons)
@lowrhyan5673 жыл бұрын
Unity is bloat, think about the users that doesn't have a good device to run your application, Unity will make it wayyy heavier while Lua will make it lightweight and fast.
@aashrithmadagiri67114 жыл бұрын
My class function is not working. I copied it exactly like it was on github, yet it still says "Call to global function 'Class' a nil value in bird.lua". Can someone please help me?
@skysong81404 жыл бұрын
Probably because you named the file 'bird.lua', the original github file is named 'Bird.lua', try changing it and see if it works?
@aashrithmadagiri67114 жыл бұрын
@@skysong8140 Ha ha what's funny is that I orginially named it "Bird.lua" but it didn't work and when i changed it to "bird.lua" the code worked. Idk why. Thanks for the reply though
@techbarikcom4 жыл бұрын
Which programming do you use?
@RahulMishra-np7fw4 жыл бұрын
Lua
@techbarikcom4 жыл бұрын
@@RahulMishra-np7fw What is this "Lua"?
@shivammaheshwari55194 жыл бұрын
@@techbarikcom its a programming language
@Grunchy0054 жыл бұрын
9/10 of the trick of getting into this is installing lua, löve2d, and some kind of editor or ide (“integrated development environment“) to make all this work. I just did all this myself a couple days ago & I completely forget all the ins and outs, it’s so convoluted.
@thomasquigley87554 жыл бұрын
Do I have to code something in my file called push.lua in bird 0??
@alexguardadok4 жыл бұрын
Copy what's here in a file named "push.lua", and put it in your game folder: github.com/Ulydev/push/blob/master/push.lua
@rafaelcarvalho20404 жыл бұрын
@Tahmid so u use a folder for the game put the push file in the same folder. If you are using VS code it has to appear in the same workspace.
@jondyason3364 жыл бұрын
this man is a sorcerer
@jacoblu514 жыл бұрын
Steven looks like clint from collegehumor
@KesSaGaming Жыл бұрын
23:47
@Roger_8084 ай бұрын
im so confused
@ignasscio4 жыл бұрын
Isn't too slow check every pipe to see if the bird has collided?
@codysantos93844 жыл бұрын
i really really love this Run 3 Game game on 88kgames
@tessiof3 жыл бұрын
41:20 forgot to multiply self.dy by dt to make movement frame rate independent. only gravity acceleration is frame rate independent here.
@iconic4102 жыл бұрын
that isn't necessary since the dy will increase every frame because of the calculation above it and increasing it further is redundant and hard to manage as well.
@tessiof2 жыл бұрын
@@iconic410 is necessary to make velocity frame rate independent
@iconic4102 жыл бұрын
the velocity is always changing when the game is running and that's good enough
@tessiof2 жыл бұрын
@@iconic410 only if you don't care to make it correct 👍
@iconic4102 жыл бұрын
Ok
@methushaelzang93694 жыл бұрын
and happening for bird-0-12
@capnjon68354 жыл бұрын
Can somebody please clarify bird 6? I felt like the dumbest person on earth after I couldn't get even a single thing of it
@capnjon68354 жыл бұрын
First of all the value of PIPE_HEIGHT in main hasn't been declared. That really got thinking about it over and over
@jacoblu514 жыл бұрын
I don't get any of it either. Wtf is for k and tables
@capnjon68354 жыл бұрын
@@jacoblu51 I got it finally, you just need to understand the variables and loops in lua... Pipepairs is one class and pipe comes within the pipe class which defines how the pipe will be in the pipepair. The rendering part of pipe is explained by love2d website
@jacoblu514 жыл бұрын
Ah
@devongrey12374 жыл бұрын
you should really be live coding these lectures. not doing so proves a lack of understanding on the instructors part and makes it harder to follow.
@jacoblu514 жыл бұрын
:o
@gdsirnishka33264 жыл бұрын
he has a limited time, realise that before stating something. also if you don’t understand anything, you most likely haven’t done the cs50x version of pong. live coding takes time and results in many errors
@jacoblu514 жыл бұрын
dude you got recked
@gdsirnishka33264 жыл бұрын
Jacob Lu what? he didn’t even reply to me, and I am most likely right. sure for stuff like web development and cs50x, they can live code because there is hardly anything. but for game development you can’t assume that he is going to live code, considering you get like 10 errors if you mess something up
@jacoblu514 жыл бұрын
rekt
@lowrhyan5673 жыл бұрын
Woah, I trought it was another Python loser not a Lua chad.
@jacoblu514 жыл бұрын
Bruh I personally don't like this form of teaching. He is just showing me the code and isn't really explaining to me the categories of everything. I dunno, maybe its just the fact that I'm in high school, but I have no idea whats going on. He can't answer any questions either. This video was made 2 years ago.
@user-nq2jq2sn2v4 жыл бұрын
This course is the one meant for those who have had at least one year of prior programming experience, or maybe less if you've already used LOVE2D or Lua. That might be your problem. Also, in the introduction (0:35), he placed a couple of email addresses. There's a chance he might answer. If not now, he might when schools reopen. No guarantee.
@jacoblu514 жыл бұрын
Ok, thanks
@marcusrashford5682 жыл бұрын
yes, the bird is too BIG first of all
@maniaque372 жыл бұрын
boring game
@EthanVandal3 жыл бұрын
At first I thought this was going to be about the conceptualization and reasoning for success of flappy bird judging by the time of the video, then I realized it's entry level programming theory of a game that is old and irrelevant to my scope of interest. Oops, see ya!. Next.
@Raj-ii1sr5 жыл бұрын
Which laptop will i require for making these games?
@zlovredniyTip5 жыл бұрын
pretty sure you can do it on raspberry pi. So dont worry, as long as it runs a text editor and a command line you can do a ton.
@personalinvestor21435 жыл бұрын
a wooden laptop
@mutee3335 жыл бұрын
To be able to run Love, any laptop which supports OpenGL2.0. If you have an older machine that doesn't support OpenlGL 2.0, you may use an OpenGL software emulator, like Mesa3D.