Make 2048 In Python | Full Python Game Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 29 ม.ค. 2025

ความคิดเห็น •

  • @TechWithTim
    @TechWithTim  9 หลายเดือนก่อน +4

    To learn programming and Python - Check out Datacamp!
    Learn Python: datacamp.pxf.io/ba4zym
    Learn Programming: datacamp.pxf.io/3e6xOy

  • @aidannt
    @aidannt 9 หลายเดือนก่อน +35

    you're the only person who still walks us through how to use pip 😅
    keep it up!

  • @ദാസപ്പൻ1
    @ദാസപ്പൻ1 9 หลายเดือนก่อน +2

    You are the only one person who teached me Socket programming correctly in 2021. 3 years passed

  • @wonnor42
    @wonnor42 9 หลายเดือนก่อน +1

    You make great and inspiring videos, Tim. I love them a lot for new inspiration. However, I stopped at this one 39:04 and thought a bit. I probably missed the purpose of this game - dont know it. But the code is defenetely something I don't want to see in a huge project: The function get_random_pos. 1) Minor... the first two lines are of absolutely of no use (in python) 2) using a key which seems strange (unless I read all the code) into an iterable that I dont know about. 3) Worst. This function could run forever

  • @chandrasekars8904
    @chandrasekars8904 9 หลายเดือนก่อน +1

    This is really an excellent channel on Python like "techie talkee"

  • @reymarckesaguirre4102
    @reymarckesaguirre4102 9 หลายเดือนก่อน +8

    I was thinking these days about how would I make grids in my python games. Then this tutorial came out.
    I am sold that Tim is a fcking mind reader.

  • @barebonestactical
    @barebonestactical 9 หลายเดือนก่อน +1

    Love watching your videos I do have a question about the logic for determining tile colors though at 24:50.
    Obviously there’s no “right” answer but wondering why not just have the colors be a dict with the possible tile values as the keys and you could simply just get the color tuple from using the tile value as an index.
    Just curious for any specific reasoning or just simply the reason of just done in another way 🙂

  • @Overlycomplicatedswede
    @Overlycomplicatedswede 9 หลายเดือนก่อน

    tim always dropping very easy to follow guides and i was wondering if someone had coded this i tried to on my own then found this video on got my version working after some tweeks!

  • @toolzshed
    @toolzshed 9 หลายเดือนก่อน +1

    Whoa sweet 🤘🏽🔥

  • @petegranneman1623
    @petegranneman1623 8 หลายเดือนก่อน

    Great content, clear explanation! Keep it up!

  • @TanmayBhatgare
    @TanmayBhatgare 9 หลายเดือนก่อน +22

    Wtf bro you made better frontend in python than me in HTML😢

    • @jacobmars1902
      @jacobmars1902 9 หลายเดือนก่อน +8

      reality is often disappointing

    • @IlTjaylI
      @IlTjaylI 9 หลายเดือนก่อน +2

      Reality is realising that you will forever be disappointed in yourself if you compare yourself to others. Many people don't get that that statement really means. It means the someone will always be better than you at something because they have more experience and sometimes an experience you will never truly match unless you put your heart to it.

    • @Mecagothits
      @Mecagothits 9 หลายเดือนก่อน

      Hahah yeah trio

  • @timermens350
    @timermens350 9 หลายเดือนก่อน +2

    Very nice! Been playing it a bit on a 8x8 grid. I noticed some unwanted behaviour in certain conditions though. Sometimes three 4's f.e. merge in one 8... I think when all 4's are. moving. Haven't figured it out yet. Thought you should know.
    Tnx for your channel. It really helps me a lot as a hobbiist "programmer". I try to motivate the son (12yo) of my girlfriend to use his laptop not only for Fortnite, and he likes your teaching style as well. Keep it up!

  • @Marzex1x
    @Marzex1x 9 หลายเดือนก่อน

    Hey bro I just wanted to say props to u for how good u did in that interview 4 years ago with Clement Mihailesco, I just watched the whole video again and tried to solve the same problem as you but in c++ it's a cool way to kind of get a feel for what you could expect in a real interview and I hope to get one soon enough. Btw any advice on how to land an internship at some of the sligtly bigger companies and also i'm not from the US so an in person internship isn't a possibility. Appreciate you 💜

  • @peyman_shabani
    @peyman_shabani 8 หลายเดือนก่อน

    Great content and so clear explanation thanks Tim😊❤

  • @justhamza_3344
    @justhamza_3344 9 หลายเดือนก่อน

    bro perfect tutorial keep it up | now im going to edit it by changing the colors a bit

  • @esrx7a
    @esrx7a 9 หลายเดือนก่อน

    Awesome Tim!

  • @DrCognitive
    @DrCognitive 9 หลายเดือนก่อน +2

    I'd rather see an enhanced/updated version of your high school game of mini-golf or whatever that game was. LOL That looked like simple fun.

  • @KindaMC
    @KindaMC 9 หลายเดือนก่อน +1

    Hey Tim! I was wondering if sometime you could make a video on how to make a web application with sign-ins (maybe using Choreo or something) to which I can just add pygame applications and play them so I can share them with friends?

  • @abdulwajid923
    @abdulwajid923 9 หลายเดือนก่อน

    Great video i learn a lot how to use pip and about selecting interpreter thank you

  • @GeneKim-g1w
    @GeneKim-g1w 9 หลายเดือนก่อน +1

    Hey Tim, I was wondering if it is possible to make a scoring system in the game. I've coded the entire program and just wanna add some final touch ups!

  • @HenryTSBs
    @HenryTSBs 6 หลายเดือนก่อน

    Can you tell me what version of VS Code are you using Tim! Thanks!

  • @Koko-So-Meitantei_
    @Koko-So-Meitantei_ 7 หลายเดือนก่อน

    34:29 I get absoluteerror: ‘Tile’ object has no attribute ‘draw’

  • @usamashami11
    @usamashami11 9 หลายเดือนก่อน +2

    Best Python Game Developer in Town 🥹
    Never in my life I thought you would be able to code one of my fav. game in Python ❤

  • @Adam9174X
    @Adam9174X 9 หลายเดือนก่อน +2

    Can you make a Tutorial about OpenGL in Python ?

  • @viktor2160
    @viktor2160 9 หลายเดือนก่อน

    Hello Tim. I am having 3-4 years of experience with python, what do you recommend to do in order to improve my skills? Thank you.

  • @thebugbyte
    @thebugbyte 4 หลายเดือนก่อน

    I am following the tutorial and its really good everything is worker except for my boundary_check in the if statement is saying that boundary_check is not a thing even though i have boundary_check = lambda tile: tile.col == 0. Please help

  • @GRSG_tech
    @GRSG_tech 9 หลายเดือนก่อน

    Tim, Love you content and I appreciate it
    Can you please make a video on python PANDAS module

  • @arnavshukla4271
    @arnavshukla4271 9 หลายเดือนก่อน

    Hi Tim! Can you please make more videos on web development?

  • @Clipaholick
    @Clipaholick 9 หลายเดือนก่อน

    amazing!

  • @samoylov1973
    @samoylov1973 9 หลายเดือนก่อน

    It would be nice, if the game gave users some kind of final score.
    score = sum([tile.value for tile in tiles.values()])
    print(f"Your score - {score}")
    And not only in konsole, but in actual game board.
    Thanks for the tutorial. Learning.

  • @SouLDYNAMOX9
    @SouLDYNAMOX9 9 หลายเดือนก่อน

    What theme do you use. I love your theme

  • @reymarckesaguirre4102
    @reymarckesaguirre4102 9 หลายเดือนก่อน +1

    So I decided to rest from this video for now, because I am getting too much info overload on the movement functionality. But I'll get back to it soon.
    HOWEVER, if there are anyone here, Android devs, wondering how to do this but with touch screen controls instead of keyboard, I made something that is admittedly not perfect, but a simple way to detect swiping. Here is how I detect if the user swiped up or down (go code the right and left, as well as a way to tell if the user meant to go on the y or x axis.):
    def main(window):
    clock = pygame.time.Clock()
    run = True
    tiles = generate_tiles()
    track_finger_x = []
    track_finger_y = []
    while run:
    clock.tick(FPS)
    for event in pygame.event.get():
    if event.type == pygame.QUIT:
    run = False
    break
    elif event.type == pygame.FINGERMOTION:
    print("Triggered Down")
    track_finger_x.append(event.x)
    track_finger_y.append(event.y)
    elif event.type == pygame.FINGERUP:
    print("Triggered Up")
    if len(track_finger_y) == 0:
    continue
    elif len(track_finger_y) > 0:
    if track_finger_y[0] > track_finger_y[len(track_finger_y) - 1]:
    print("Moved up")
    elif track_finger_y[0] < track_finger_y[len(track_finger_y) - 1]:
    print("Moved down")
    track_finger_y.clear()

    • @reymarckesaguirre4102
      @reymarckesaguirre4102 9 หลายเดือนก่อน +1

      I also forgot to remove the print, but I used those for debug during the coding process.
      I couldn't find a lot of tutorials online about Pygame swipe, and the FINGERMOTION.dy object is only measuring too short distances to be of any use.

  • @yousuf_mamin5767
    @yousuf_mamin5767 9 หลายเดือนก่อน

    added game over text , escape key to restart option, now trying to display win message when 2048 is reached.

  • @zixinzhang6157
    @zixinzhang6157 7 หลายเดือนก่อน +1

    There is an error to fix, because when there are four 4 in a line, they merge into a 8 and a 4...

  • @NikhilVerma-jk9ng
    @NikhilVerma-jk9ng 9 หลายเดือนก่อน

    You are the best

  • @gianespineda
    @gianespineda 9 หลายเดือนก่อน

    Can you make a tutorial in htmx and flask

  • @KindaMC
    @KindaMC 9 หลายเดือนก่อน +1

    I noticed at 5:43, you put "RGV" instead of "RGB," I assume that's a typo? Also, later it says PI GAME instead of PYGAME.

  • @nirmal-b3i
    @nirmal-b3i 4 หลายเดือนก่อน

    bro I copy pasted your code on vscode and it is showing syntax error i did install pygame before but still

    • @Dr.Hollstein
      @Dr.Hollstein หลายเดือนก่อน

      In the bottom right corner, there should be a version of python. Click on that and choose another version until it works

  • @og_rexsteve
    @og_rexsteve 9 หลายเดือนก่อน

    Just to think I am currently hooked on this game at the moment :)

  • @-PIETROO-
    @-PIETROO- 9 หลายเดือนก่อน

    19:14

  • @BobChess
    @BobChess 9 หลายเดือนก่อน +1

    This game is from 2048. Far from future

  • @justhamza_3344
    @justhamza_3344 9 หลายเดือนก่อน

    also a 4 merged into a 16 but never mind🤪

  • @riyaops4090
    @riyaops4090 9 หลายเดือนก่อน

    game over kaha hai isme game over likha bhi to ana chaiye game chlta hi jara h

  • @AbleslayerCollectives
    @AbleslayerCollectives 7 หลายเดือนก่อน

    pygame has no attribute init very bad tutorial no one should watch this