Skip to content

Commit 881b80e

Browse files
committed
2 parents 16d9bd3 + 52c75d6 commit 881b80e

File tree

17 files changed

+2323
-10
lines changed

17 files changed

+2323
-10
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,11 @@ Here are a few article ideas that we'd love for you to write:
5454

5555
## Publishing States
5656

57-
- false — Not published on Vercel or the production site
58-
- vercel — Published on the Vercel preview environment, but not yet live on the production site
59-
- live — Published and visible on the production site
57+
Follow the publishing states given below for getting your project tutorials live on the platform. In an ideal publishing cycle, the states will move in order from top to bottom, starting with unpublished to the final state of "live".
58+
59+
- false — Not published on Vercel or the production site; This property can also be omitted.
60+
- beta — Published on the preview environment, but not yet live on the production environment.
61+
- live — Published and visible on the production environment.
6062

6163
## Additional Notes
6264

projects/analyze-twitch-data-with-sqlite/analyze-twitch-data-with-sqlite.mdx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,24 @@ tags:
2323

2424
[Twitch](https://www.twitch.tv) is a live streaming platform where millions of people come together every day to watch, chat, and create content in real time. Launched in 2011 as a site focused on video game streaming, Twitch has since expanded to include music, art, sports, and “just chatting” streams.
2525

26-
For history buffs, Twitch originated as a pivot from Justin.tv, a website launched in 2007 by Justin Kan, Emmett Shear, Michael Seibel, and Kyle Vogt (household names in San Francisco and people I’ve admired for years).
26+
For history buffs, Twitch originated as a pivot from **Justin.tv**, a website launched in 2007 by Justin Kan, Emmett Shear, Michael Seibel, and Kyle Vogt (now household names in San Francisco).
2727

2828
Very quickly, Twitch became an underground sensation. During college, my roommates and I spent countless hours watching streamers play our favorite game, Dota 2, while eating and hanging out. It was a centerpiece of our “sadboy” days and a platform that meant a lot to us.
2929

3030
Here’s me streaming a Dota 2 match in 2014 to 13 viewers:
3131

3232
![screenshot](https://i.imgur.com/sdllIwn.gif)
3333

34-
Today, new streamers like KaiCenat, IShowSpeed, and Ludwig are taking streaming to new heights and breaking records.
34+
Today, new streamers like Kai, Speed, and Ludwig are taking it to new heights and breaking records.
3535

3636
In this project tutorial, we will explore a dataset about top Twitch streamers and uncover insights using SQLite. These are real data from [Kaggle](https://kaggle.com), a website with 500,000+ public datasets.
3737

3838
The two CSV files we have are:
3939

40-
- [Top 1000 Twitch Streamers (May 2024)](https://www.kaggle.com/datasets/hibrahimag1/top-1000-twitch-streamers-data-may-2024) featuring streamers like [kaicenat](https://www.twitch.tv/kaicenat) and [jynxzi](https://www.twitch.tv/jynxzi).
41-
- [Top 1000 Twitch Streamers (2021)](https://www.kaggle.com/datasets/aayushmishra1512/twitchdata) featuring streams like xQc, summit1g, TimTheTatMan, and DrDisrespect.
40+
- [Top 1000 Twitch Streamers (2024)](https://www.kaggle.com/datasets/hibrahimag1/top-1000-twitch-streamers-data-may-2024) featuring streamers like [KaiCenat](https://www.twitch.tv/kaicenat) and [Jynxzi](https://www.twitch.tv/jynxzi).
41+
- [Top 1000 Twitch Streamers (2021)](https://www.kaggle.com/datasets/aayushmishra1512/twitchdata) featuring [xQc](https://www.twitch.tv/xqc), [summit1g](https://www.twitch.tv/summit1g), [TimTheTatman](https://www.twitch.tv/timthetatman), and [pokimane](https://www.twitch.tv/pokimane).
4242

43-
Do you recognize any of the names?
43+
Do you recognize any of the names?
4444

4545
Pick your poison (dataset) and let’s dive in!
4646

@@ -58,8 +58,8 @@ You should see a prompt that says `sqlite>`.
5858

5959
Download one of the CSV files and open it up to make sure the CSV file is working:
6060

61-
- Top 1000 Twitch Streamers (2024)
62-
- Twitch Streamers (2021)
61+
- **[streamers2024.csv](https://github.com/codedex-io/projects/blob/main/projects/analyze-twitch-data-with-sqlite/streamers2024.csv)**
62+
- **[streamers2021.csv](https://github.com/codedex-io/projects/blob/main/projects/analyze-twitch-data-with-sqlite/streamers2021.csv)**
6363

6464
A **CSV** file stands for **C**omma-**S**eparated **V**alues file. It’s a simple way to store spreadsheet data in a plain text format. Each line in the file represents a row, and the columns in that row are separated by commas.
6565

projects/analyze-twitch-data-with-sqlite/streamers2021.csv

Lines changed: 1001 additions & 0 deletions
Large diffs are not rendered by default.

projects/analyze-twitch-data-with-sqlite/streamers2024.csv

Lines changed: 1000 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
---
2+
title: Get Started with LÖVE2D and Lua
3+
author: Ellie Popoca
4+
uid: 11zhRKeJCWWcD7IkTJBtuK3Mkvo1
5+
datePublished: 2025-10-17
6+
published: beta
7+
description: Learn how to set up LÖVE, a popular Lua framework used to make 2D games, and learn the basics to get started.
8+
header: https://github.com/codedex-io/projects/blob/main/projects/get-started-with-love2d-and-lua/images/banner.gif?raw=true
9+
bannerImage: https://github.com/codedex-io/projects/blob/main/projects/get-started-with-love2d-and-lua/images/banner.gif?raw=true
10+
readTime: 30
11+
prerequisites: Lua
12+
versions: None
13+
tags:
14+
- game-dev
15+
- lua
16+
Courses:
17+
- lua
18+
---
19+
20+
## LÖVE2D
21+
22+
<ImageZoom src="https://github.com/codedex-io/projects/blob/main/projects/get-started-with-love2d-and-lua/images/ERBG554.png?raw=true" />
23+
24+
[LÖVE2D](https://love2d.org/) is a popular [Lua](https://www.lua.org/about.html) framework that's widely used to make 2D games. It provides tools and functions to draw graphics, play sound, handle input, and manage physics, but it doesn't come with its own viewport or scene viewer like Unity or Roblox Studio. You'll use code to write game logic!
25+
26+
This framework will be a great option if you want to:
27+
28+
- 🧩 Build 2D games
29+
- 🎱 Prototype game ideas quickly
30+
- 🌙 Use Lua to explore object-oriented and modular programming concepts
31+
- ⌨️ Make games that run on Windows, macOS, and Linux
32+
33+
LÖVE2D is minimal and lightweight. You write code, press play, and you're done. Roblox Studio and other game engines have a steeper learning curve due to their ecosystem, physics engine, and networking systems.
34+
35+
Let's get started with downloading LÖVE2D.
36+
37+
## Download LÖVE2D
38+
39+
Lua comes included in LÖVE, and we can begin using it in our editor of choice once downloaded on our computer!
40+
41+
Head to the [LÖVE](https://love2d.org/) website, select your device, and download.
42+
43+
<ImageZoom src="https://github.com/codedex-io/projects/blob/main/projects/get-started-with-love2d-and-lua/images/VXC5433.png?raw=true" />
44+
45+
### Windows/Linux
46+
47+
You'll want to add LÖVE to your **system environment** variables this time. Open your Control Panel, and search for **environment variables**. You'll see an option that says "Edit the system environment variables"
48+
49+
- Click on this panel, and click **Environment Variables** and select `Path` in **System Variables for YOUR_COMPUTER**, and find `Path` and click **Edit**.
50+
- Click **New** and hit **Browse**
51+
- Browse to your program files and find where the LÖVE folder was saved when you downloaded the folder.
52+
- Select the folder, and press OK to exit.
53+
54+
Add the LÖVE application to your Desktop for easy access.
55+
56+
### MacOS
57+
58+
Once downloaded, unzip the folder and click on the application. If you're unable to open it, head to System Settings > Privacy & Security > and allow LÖVE to be used on your computer. LÖVE will be blocked, and you'll have to accept an internet download.
59+
60+
You'll need to add the LÖVE application to your Desktop or the Dock for easy access to run your game or application.
61+
62+
## Running your first program
63+
64+
To test that everything is functioning correctly, you'll run your first program
65+
66+
- Create a folder and name it **Lua_example**, or whatever you would like!
67+
- Inside it, create a file called **main.lua**. LÖVE will look for this file to run your game; Otherwise, it won't work.
68+
- Open this file in your IDE of choice and type in the following lines of code:
69+
70+
71+
```lua
72+
function love.draw()
73+
love.graphics.print(“Hello World!!”, 300, 400)
74+
end
75+
```
76+
77+
Save your file.
78+
79+
Then, return to the location where you saved your folder, and drag and drop the **Lua_example** folder into the shortcut icon on your desktop or the dock.
80+
81+
In the command line, you can also run your code:
82+
83+
On Mac, you can run:
84+
85+
```terminal
86+
love /path/to/your/game/folder
87+
```
88+
89+
If `love` is not recognized, run the following command in your **Terminal**:
90+
91+
```terminal
92+
sudo ln -s /Applications/love.app/Contents/MacOS/love /usr/local/bin/love
93+
```
94+
95+
On Windows, you'll run:
96+
97+
```terminal
98+
love C:\path\to\your\game\folder
99+
```
100+
101+
You'll see your game appear!
102+
103+
<ImageZoom src="https://github.com/codedex-io/projects/blob/main/projects/get-started-with-love2d-and-lua/images/KAKG29R.png?raw=true" />
104+
105+
106+
## Programming in LÖVE2D
107+
108+
109+
To start programming LÖVE2D, you'll need to know that in every LÖVE game, you need 3 main callback functions:
110+
111+
```lua
112+
function love.load()
113+
-- Runs once at startup
114+
-- Initialize variables, load assets
115+
end
116+
117+
function love.update(dt)
118+
-- Runs every frame
119+
-- dt = delta time (time since last frame)
120+
-- Update game logic here
121+
end
122+
123+
function love.draw()
124+
-- Runs every frame after update
125+
-- Draw everything to the screen
126+
end
127+
```
128+
129+
The `love.load()`, `love.update()`, and `love.draw()` functions all work together to provide you with the organization you'll need to program your game. This will look similar to other built-in functions if you're familiar with Phaser or P5.js, since they both follow this structure as well.
130+
131+
You'll notice in our sample program that we drew some text in the `love.draw()` function.
132+
133+
Here's another example you can copy and paste and look at how this code will look in your output:
134+
135+
```lua
136+
function love.load()
137+
x = 50
138+
y = 50
139+
speed = 200
140+
end
141+
142+
function love.update(dt)
143+
if love.keyboard.isDown("right") then
144+
x = x + speed * dt
145+
end
146+
if love.keyboard.isDown("left") then
147+
x = x - speed * dt
148+
end
149+
if love.keyboard.isDown("down") then
150+
y = y + speed * dt
151+
end
152+
if love.keyboard.isDown("up") then
153+
y = y - speed * dt
154+
end
155+
end
156+
157+
function love.draw()
158+
love.graphics.circle("fill", x, y, 25)
159+
end
160+
```
161+
<ImageZoom src="https://github.com/codedex-io/projects/blob/main/projects/get-started-with-love2d-and-lua/images/BWKGJ33.gif?raw=true" />
162+
163+
- `function love.load()`: Use it to set up initial values and load resources
164+
- `function love.update(dt)`: Use it to update game logic, positions, check collisions, etc.
165+
- `function love.draw()`: Use it ONLY for drawing things to the screen
166+
167+
168+
## Next Steps
169+
Now that you're all set up, you can get started with programming your game ideas that you want to develop. Anything 2D: The framework is flexible. If you can imagine a 2D game, you can build it in LÖVE!
170+
171+
Here are some ideas to get you started:
172+
- **Breakout/Brick Breaker**: A paddle at the bottom bounces a ball to destroy bricks at the top. Learn about physics, bouncing, collision with multiple objects, and incrementally harder levels.
173+
- **Top-Down Maze Game**: A player navigates through a maze, avoiding enemies that chase them. Collect items to reach the goal. Great for learning movement, pathfinding, and enemy AI basics.
174+
175+
176+
Here are some resources for you to check out:
177+
- [LÖVE Wiki](https://love2d.org/wiki/Main_Page)
178+
- [LÖVE Tutorials](https://love2d.org/wiki/Category:Tutorials)
179+
- [Getting Started with LÖVE](https://www.youtube.com/watch?v=tdTitF6z-UA&list=PLS9MbmO_ssyBAc9wBC85_WG9aT88KGxH8&index=14)
180+
- [Loading & Drawing Images in LÖVE](https://www.youtube.com/watch?v=2U2UdD2jT5U)
181+
182+
Happy coding!
37.6 KB
Loading
426 KB
Loading
353 KB
Loading
102 KB
Loading
510 KB
Loading

0 commit comments

Comments
 (0)