Programming Snake in VIM Script and playing the game in VIM text editor!

Опубликовано: 02 Октябрь 2024
на канале: Monkey see, monkey do
373
23

===============================================
VIM Snake: https://github.com/maksimKorzh/vim-snake
===============================================

=====================================================
VIM Tutorials (full playlist)
=====================================================
   • Should I learn VIM ? ( No matter what...  

==========================
Monkey See, Monkey Do LINUX
==========================
https://github.com/maksimKorzh/msmd-l...

====================================
Distro independent linux package manager
====================================
https://github.com/maksimKorzh/dipi

================================================
VICI - Minimalist cross-platform terminal based text editor
================================================
https://github.com/maksimKorzh/vici

==================================
ED - The standard Linux Text Editor in Go
==================================
https://github.com/maksimKorzh/ed

====================
MY TOY TEXT EDITORS
====================

VI-like text editor in 100 lines of C++ code:
https://github.com/maksimKorzh/ved

Text editor in 50 lines of python:
https://github.com/maksimKorzh/v

VI-like text editor in 125 lines of python:
https://github.com/maksimKorzh/edit/b...

Text editor with python shell:
https://github.com/maksimKorzh/pi

Tiny vi-like text editor in only 125 lines of python code:
https://github.com/maksimKorzh/vip

Text editor with syntax highlighting:
https://github.com/maksimKorzh/code

Kilo text editor cone in C:
https://github.com/maksimKorzh/kilo-c...

Kilo text editor port to ESP32:
https://github.com/maksimKorzh/esp32-...

===============================================
TUTORIALS COVERING MOST OF THE ABOVE PROJECTS
===============================================
   • Revolutionary brand new approach to t...  

=====================
SUPPORT THE CHANNEL
=====================
Patreon:   / code_monkey_king  
PayPal: [email protected]

==========
CONTENTS
==========
Contents:

00:00 Intro
01:20 Most common variable types in VIM script
04:20 Game init settings explained
04:48 Writing s:init_screen()
06:00 Restoring VIM config after game exists
08:50 Writing a function to fill the text buffer with white spaces
15:04 How rendering a character to screen actually works
16:00 Writing s:print_at() to print char at ROW, COL
20:30 Writing s:print_message() to print string at ROW, COL
22:43 Writing main game loop
29:16 Using timer to update frames every 200ms
31:37 Writing code to update inner snake representation
32:38 Moving the snake
35:44 Rendering snake to screen
40:04 Generating new apple at random place on screen
43:24 Using key mappings to achieve non-blocking get character behavior
44:19 Controlling snake direction with 'h', 'j', 'k', 'l'
45:35 Snake self collision detection
48:38 Wrapping snake around the screen
53:43 Coloring snake & apple
55:15 PLAYING THE GAME OF SNAKE IN VIM TEXT EDITOR
57:05 Outro