background top icon
background center wave icon
background filled rhombus icon
background two lines icon
background stroke rhombus icon

Download "Using AI To Build A Game From Scratch (NO Experience)"

input logo icon
Video tags
|

Video tags

AI
Artificial Intelligence
FutureTools
Futurism
Digital Marketing
Internet Marketing
Machine Learning
Deep Learning
Game Development
ai game development
no code game development
chatgpt
gpt-4
gpt4
gpt 4
chat gpt
open ai
ai tools
ai game
gpt4 game
made a game
ai
artificial intelligence
chatgpt examples
openai
chatgpt tutorial
game development
game dev
making a game with chatgpt
chatgpt code
devlog
gpt 4 demo
openai chatgpt
aigame
gamedev
Subtitles
|

Subtitles

subtitles menu arrow
  • ruRussian
Download
00:00:01
where people have used chat GPT to build
00:00:04
video games the thing about all those
00:00:06
videos is almost every single one of
00:00:08
them the person already had at least a
00:00:11
little bit of coding knowledge me
00:00:12
personally I have like no coding
00:00:14
knowledge I have no clue how to start to
00:00:16
build a video game so in this video I'm
00:00:19
going to see if I can use chat GPT to
00:00:22
build a very basic video game so let's
00:00:25
go ahead and see what we can do so the
00:00:26
first thing I did was I went over to
00:00:28
code.visualstudio.com and I downloaded
00:00:31
Visual Studio code this is a free tool
00:00:33
to sort of help organize any code that
00:00:36
you write so I created a folder on my
00:00:38
computer here called building a game
00:00:40
it's a completely empty folder there's
00:00:41
nothing in it yet inside of Visual
00:00:43
Studio code I'm going to open that
00:00:44
folder building a game select folder and
00:00:47
now you can see I've got a completely
00:00:49
blank slate here to start building
00:00:51
something problem is I don't really have
00:00:53
an idea for a game yet no I don't want
00:00:54
to use any sort of advanced coding
00:00:56
languages yet I want to keep it fairly
00:00:57
basic so let's just keep it to to HTML
00:01:01
CSS and JavaScript give me concepts for
00:01:04
a simple game that I can create using
00:01:06
HTML CSS and JavaScript only the game
00:01:11
should have visual elements and not to
00:01:15
be a text based game alright so it gave
00:01:19
us five games I think a platformer
00:01:21
sounds the most fun probably also the
00:01:23
most challenging of the list so let's go
00:01:24
ahead and see if we can make it make a
00:01:26
simple platformer I'd like to create a
00:01:29
simple platformer game what are the
00:01:32
first steps to create it okay so it
00:01:36
actually gave me a whole bunch of steps
00:01:37
to follow so step one set up the project
00:01:39
structure create a folder for your
00:01:41
project and create the following files
00:01:43
within it index.html style.css script.js
00:01:47
so let's jump back over to our Visual
00:01:50
Studio code here and let's create these
00:01:52
three files
00:01:54
index.html style dot c s s
00:01:58
script.js yes all right so now we've got
00:02:01
our three files and I can quickly jump
00:02:03
between any of these and add code into
00:02:05
any of these Pages here so now if I jump
00:02:06
back over to chat GPT here it says
00:02:08
create the HTML structure in the
00:02:10
index.html file set up a basic HTML
00:02:13
structure include a canvas element to
00:02:15
render the game and then it just gave me
00:02:17
this so let's go ahead and copy all this
00:02:18
code and we'll paste this into our
00:02:20
index.html page here like it said to now
00:02:23
down here in step three style the game
00:02:25
in the style.css file add some basic
00:02:28
styles to Center the canvas and set a
00:02:30
background color so let's go ahead and
00:02:31
copy this code here and in our style.css
00:02:34
we'll go ahead and just paste that whole
00:02:35
thing in there step four set up the
00:02:37
JavaScript in the script.js file start
00:02:40
by getting the canvas element and 2D
00:02:42
rendering context so we'll copy this
00:02:44
into our Javascript file here all right
00:02:47
game Loop and rendering set up the game
00:02:49
Loop using request animation frame and
00:02:51
create functions to update the game
00:02:53
State and render objects on the canvas
00:02:55
so we'll go ahead and copy this code and
00:02:57
this looks like it goes into our
00:02:58
javascript.js file here go ahead and
00:03:00
paste that in and then it stopped giving
00:03:02
me code here so it says create game
00:03:03
objects to find the player and platform
00:03:05
objects their positions and any
00:03:07
necessary physics properties like
00:03:09
gravity velocity and collision detection
00:03:11
player movement and controls Collision
00:03:13
detection level design polish and
00:03:14
testing so it gave me some basic code
00:03:16
for the first handful of steps but then
00:03:17
stopped giving me the code for the rest
00:03:19
so I think we're going to have to have
00:03:20
it render out the code for us for the
00:03:22
rest of these objects but let's see what
00:03:23
this does right now so if I go to
00:03:25
index.html let's go ahead and open this
00:03:28
in Chrome and literally nothing happens
00:03:30
I just get a blank white screen when I
00:03:31
open this in Chrome so we'll go ahead
00:03:33
and close that so I think the problem
00:03:35
now is that we haven't created any game
00:03:36
objects or player movement controls or
00:03:39
anything like that so I think we need to
00:03:41
tell chat GPT to do that for us how do I
00:03:44
create the game objects from Step six
00:03:49
all right so it gave me a bunch of code
00:03:51
here so we've got constant player a
00:03:53
bunch of code platform a bunch of code
00:03:55
again I don't know coding so I honestly
00:03:58
don't totally know what I'm looking at
00:03:59
I'd actually I'm gonna have to ask GPT
00:04:02
where do I put the code where do I paste
00:04:05
the above code Snippets into my game
00:04:08
code so this is pretty cool it's
00:04:10
actually telling me where in the
00:04:12
original code to paste everything so it
00:04:14
says paste the player object definition
00:04:15
right after the CTX constant
00:04:18
initialization we can see here we've got
00:04:21
our CTX constant initialization right
00:04:24
here I'm assuming so let's go ahead and
00:04:26
grab all of this code here paste it
00:04:29
where it told me to paste it which is
00:04:30
right there all right now let's see what
00:04:33
happens if I run our index here now we
00:04:35
have a little blue square
00:04:36
our blue square is our object I think
00:04:39
we're going to figure out how to make it
00:04:40
move next all right so it says after
00:04:42
integrating these Snippets into your
00:04:44
script.js file your game should now
00:04:46
render the player and platforms on the
00:04:48
canvas so I guess the little blue
00:04:50
rectangle is our player next you can
00:04:52
work on implementing player movement
00:04:54
controls and collision detection as
00:04:56
mentioned in the previous responses so
00:04:58
if we scroll all the way back up here we
00:05:00
created our game objects we did step six
00:05:02
so now step Seven Player movements so
00:05:04
let's say write the code for player
00:05:07
movements please include where I should
00:05:11
paste them into my current code let's
00:05:15
make sure it's very clear that I don't
00:05:17
know what I'm doing here alright so it
00:05:18
gave me a bunch of code to paste into
00:05:20
our existing JavaScript code here so
00:05:22
let's go ahead and start doing it and
00:05:25
now let's go ahead and run our
00:05:26
index.html file here go run start
00:05:29
without debugging now if I hit
00:05:32
now I can make a blue line go across
00:05:34
this screen it doesn't seem to go up or
00:05:37
down but that's so far all that happens
00:05:40
it says now your player should be able
00:05:42
to move left and right jump and be
00:05:43
affected by gravity the Collision
00:05:45
detection is basic and only checks for
00:05:47
the ground canvas bottom you'll need to
00:05:49
add more Advanced Collision detection to
00:05:51
handle platforms and other objects in
00:05:53
the game the above code seems to make a
00:05:57
giant blue line on the screen that goes
00:06:01
left or right but it doesn't appear to
00:06:06
jump and the object leaves a trail of
00:06:10
where it's been how do I resolve this
00:06:14
here's the updated render function so
00:06:17
let's go ahead and update this render
00:06:18
function here and now let's go ahead and
00:06:20
run this again see what happens all
00:06:22
right so now our player moves left and
00:06:25
right but there doesn't appear to be any
00:06:26
sort of jump still this fixed the
00:06:29
trailing issue but the players still
00:06:33
does not appear to jump how do I get the
00:06:37
jump to function properly alright so it
00:06:40
gave me a new piece of code to try and
00:06:43
go ahead and try to run it well I still
00:06:44
got left and right but I still don't
00:06:46
have up or down jumping movement I feel
00:06:48
like this is where those previous videos
00:06:50
people actually know what they're doing
00:06:51
with code would be able to go I see the
00:06:53
problem and then they went and fixed it
00:06:55
I don't know what I'm doing with code
00:06:56
and so I can't spot the problem to fix
00:06:58
it myself so I guess we'll just come
00:07:00
back to this aspect of it let's move on
00:07:02
to what the next step was so I'm going
00:07:04
to scroll all the way back to the top
00:07:05
here so Collision detection Implement
00:07:07
Collision detection between the player
00:07:09
and platforms so the player can stand on
00:07:12
them and not fall through how do I add
00:07:15
the code for step eight Collision
00:07:18
detection please include where I should
00:07:22
paste the code all right so now it's
00:07:24
writing me some code for the Collision
00:07:26
detection let's go ahead and copy this
00:07:28
we'll paste it down below the last code
00:07:30
that we wrote here so I can still move
00:07:32
left and right right still can't seem to
00:07:33
jump so I'm just going to continue
00:07:34
through the process right now let's
00:07:36
follow all the original steps and then
00:07:38
we'll start troubleshooting whatever it
00:07:39
seems to be missing so we just did the
00:07:41
Collision detection steps now we need
00:07:44
level design create the layout of the
00:07:45
level placing platforms and obstacles
00:07:47
for the player to Navigate please write
00:07:49
the code for the level design in Step
00:07:54
nine remember to tell me where to paste
00:07:58
each piece of code all right so it gave
00:08:01
me a bunch of code I'm just going to go
00:08:02
ahead and copy and paste it exactly
00:08:04
where it tells me to copy and paste it
00:08:06
okay so I finished copying and pasting
00:08:07
all the code that it suggested here not
00:08:09
seeing any difference what I want to do
00:08:12
is I'm going to take all of this
00:08:14
JavaScript code that I've pasted here
00:08:16
I'm going to copy it and I'm going to
00:08:17
come over to chatgpt and say here is the
00:08:20
JavaScript that I have so far can you
00:08:24
please debug it and give me better code
00:08:28
let's just see what it does all right so
00:08:30
now it completely rewrote all of the
00:08:33
code that I pasted in it gave me new
00:08:35
code to replace it with so let's go
00:08:37
ahead and copy all of this here come
00:08:39
over to our JavaScript and let's just
00:08:40
literally replace everything and now if
00:08:43
we go run our game let's go ahead and
00:08:44
refresh this we've got our player moving
00:08:46
left and right but it didn't seem to fix
00:08:48
anything so it still moves left and
00:08:50
right just like it did before but
00:08:51
supposedly we got cleaner code I guess
00:08:53
all right so now let's go ahead and
00:08:55
start getting it closer to what we
00:08:57
actually want our game has no floor
00:09:01
please create a green floor for the game
00:09:06
to represent grass tell me where to
00:09:10
paste the code into the existing game
00:09:13
script all right so now I'm going to go
00:09:15
ahead and replace the function render
00:09:17
here as it specifies so now I actually
00:09:20
have a green floor I have a blue player
00:09:22
that moves left and right still doesn't
00:09:24
jump I've got a green grass floor and
00:09:27
I've got a couple platforms if I run to
00:09:29
the edge of this I was able to make it
00:09:31
jump at the edge but that was it so
00:09:34
let's go back into our chat GPT and it
00:09:38
looks like we need to update some
00:09:39
Collision detection on these platforms
00:09:42
and we still got to figure out this jump
00:09:43
thing because the jumping doesn't seem
00:09:45
to work on its own let's just say the
00:09:47
player seems to be able to walk through
00:09:51
the platforms how do we code it so that
00:09:55
they will run into the platforms instead
00:09:59
please tell me where to paste the new
00:10:02
code so just go ahead and replace all of
00:10:04
this with the new code it just gave us
00:10:06
now we've got our game and it still goes
00:10:09
right through the platform the player
00:10:10
still appears to go behind the platform
00:10:15
instead of colliding with it how should
00:10:18
I fix this place this whole thing that
00:10:22
seemed to fix it but I still can't jump
00:10:24
unless I'm at the edge of a platform
00:10:26
jumping only seems to work when I come
00:10:30
to the edge of a plan platform how do I
00:10:34
make it so the player can jump at any
00:10:38
time please tell me where to paste the
00:10:42
new code all right so it appears that
00:10:43
I've reached my usage cap of gpt4 for
00:10:46
right now so what I'm going to do to get
00:10:48
around that I'm actually going to go to
00:10:49
the open AI playground here I'm going to
00:10:51
switch the mode to chat and then switch
00:10:53
it to gpt4 and I should be able to pick
00:10:56
up where I left off using the gpt4 chat
00:10:59
using my API key here on the openai
00:11:02
playground so what I'm going to do is
00:11:04
I'm going to go ahead and pick up where
00:11:06
I left off by copying all of the code
00:11:08
here pasting it into the GPT playground
00:11:10
and typing building a side scrolling
00:11:15
platform game this is my existing
00:11:20
JavaScript code please use this as
00:11:24
reference for future questions then it
00:11:27
says thank you for sharing your code
00:11:28
I'll use it as reference when answering
00:11:30
your future questions related to this
00:11:31
side scrolling plan form game if you
00:11:33
have any questions or need assistance
00:11:34
feel free to ask so I'm going to go
00:11:35
ahead and add a message and say in the
00:11:38
current code the player can only jump
00:11:41
when it reaches the edge of a platform
00:11:45
it can't jump while in the middle of a
00:11:49
platform or while on the ground please
00:11:53
help me debug this and tell me which
00:11:57
code needs replacing okay so it's
00:11:59
telling me to replace everything in the
00:12:01
update section so let's go ahead and
00:12:03
copy this code go ahead and replace this
00:12:05
update section see if that actually
00:12:07
solves anything okay so literally after
00:12:09
about an hour and a half of going back
00:12:12
and forth with GPT and saying that
00:12:14
didn't work what should I try next that
00:12:16
didn't work what should I try next I now
00:12:18
have a blue square that can jump while
00:12:21
on the platforms and also jump while on
00:12:24
the ground I'm getting somewhere can't
00:12:26
believe it but I actually have code that
00:12:28
does what it's supposed to do my little
00:12:30
blue character moves around he could
00:12:31
jump on the ground If he if he hits the
00:12:34
platform above him he he won't go
00:12:36
through it anymore he could jump off the
00:12:38
ground onto the platform she's not
00:12:40
moving through the platforms so far we
00:12:42
have a game that's actually starting to
00:12:44
look like an actual platformer I didn't
00:12:46
write a single line of code pretty much
00:12:48
I just told it what I wanted and when it
00:12:50
didn't work I just kept on going back to
00:12:53
GPT and saying that didn't work what
00:12:55
should I try next I've literally been
00:12:56
doing that for hours now all right so
00:12:59
let's go ahead and see if we can change
00:13:00
this square into something else can we
00:13:03
change the square player into a stick
00:13:08
figure instead of a square let's see if
00:13:12
it'll allow me to do that all right so
00:13:14
let's replace the code for function
00:13:16
render here hey look we got a little
00:13:19
stick figure dude instead of a square
00:13:21
jumping around oh my God I can't believe
00:13:23
that actually worked okay so at this
00:13:26
point I had to actually stop recording
00:13:28
because I had recorded about four hours
00:13:30
worth of footage of me creating this
00:13:32
game and the file sizes were starting to
00:13:35
get insane and I knew it was going to be
00:13:37
a nightmare to edit so I decided I would
00:13:39
continue to work on the game and then
00:13:41
show you what I did instead of trying to
00:13:43
record it all in real time as I'm doing
00:13:45
it so I managed to get back into chat
00:13:47
GPT and I was able to start having
00:13:49
conversations with it again so what I
00:13:50
did was I pasted in all of the existing
00:13:52
code because if you remember I jumped
00:13:55
over to GPT playground to continue the
00:13:57
code so now chatgpt didn't have the
00:14:00
context of any of the new changes I made
00:14:01
so I pasted in all of the existing code
00:14:04
that I had created inside of GPT
00:14:06
playground here and then when I got to
00:14:08
the bottom I said here's the JavaScript
00:14:09
for the game I'm developing I'm going to
00:14:11
ask questions to improve it at this
00:14:13
point it was still the game that was
00:14:15
just the three little platforms and my
00:14:16
little dude could just jump around on
00:14:18
the screen and nothing else happened so
00:14:19
I said the game should be a side
00:14:21
scroller as the player moves to the
00:14:23
right the game should continue to move
00:14:24
with him and new platform should appear
00:14:26
please write the code for this tell me
00:14:28
where to paste the new code it gave me a
00:14:29
whole bunch of new code I still got
00:14:31
confused and said where do I paste the
00:14:33
code for step two so I said my apologies
00:14:35
and it told me exactly where to paste it
00:14:36
it said replace this code with this code
00:14:39
you gave me new code now you have to
00:14:41
tell me where to put the code and Chachi
00:14:43
BT will tell you where to put the code
00:14:44
so if you're not a coder you can
00:14:46
literally have chatgpt write the code
00:14:48
and then say make sure you put the code
00:14:50
in this exact spot in your existing code
00:14:53
and that's what I was doing so I said
00:14:54
now I'd like to add little coins
00:14:56
throughout the level for the player to
00:14:57
collect it wrote a bunch of code for me
00:14:59
and once again I said where do each of
00:15:01
these code Snippets need to be based in
00:15:03
and I went back and forth and back and
00:15:04
forth like this until eventually I've
00:15:07
got a little dude who can run around and
00:15:09
collect coins you can see up in the top
00:15:10
left he's got a score and I can jump
00:15:12
between platforms and collect coins and
00:15:15
as I collect coins the score increments
00:15:18
and if I press spacebar I jump between
00:15:20
and it's just an infinite scroller I
00:15:22
just keep on going and if I fall off
00:15:25
it's game over so to prettify the game
00:15:27
Let's jump to our friends over at Mid
00:15:30
Journey okay so I created a background
00:15:32
image with mid-journey this was the
00:15:35
background that I created here I made it
00:15:37
a giant wide background image with a 10
00:15:40
to 1 aspect ratio and then back inside
00:15:42
of GPT playground I said I would like to
00:15:44
use an image for the background of the
00:15:46
game the image should be full width and
00:15:48
loop as the player moves how to
00:15:50
implement this into my current code
00:15:51
explain exactly where to paste the code
00:15:53
and you can see I already pasted my
00:15:54
entire JavaScript code over here on the
00:15:56
sidebar you can see it put that giant
00:15:58
background image behind my player but
00:16:00
it's not taking up the full height of
00:16:03
the screen alright so now I need to
00:16:05
solve that problem I'm going to jump
00:16:07
over to GPT here and I'm going to say
00:16:09
the background image is not spilling the
00:16:13
full height of the game canvas how do I
00:16:17
resolve this
00:16:18
all right so it gave me some new code I
00:16:20
pasted it in and now it's taking up the
00:16:23
full height of the canvas here as you
00:16:25
can see I'm gonna go and make some
00:16:27
additional tweaks to it probably go back
00:16:30
and forth with chat GPT I want to make
00:16:31
sure it adds a reset button here so I
00:16:33
don't have to refresh the page I want to
00:16:35
change the look of my character I'll
00:16:37
probably generate something else with
00:16:39
mid-journey I want to add some more
00:16:40
color to the platforms so I'm just going
00:16:42
to go back and forth with chat GPT a
00:16:44
little bit until I kind of dial in on
00:16:46
the game that I'm looking for okay so
00:16:48
now I just added a reset button so if
00:16:51
you die you press reset and it starts
00:16:52
you back over all right so after going
00:16:54
back and forth a whole bunch here's
00:16:56
where I'm currently at with my game I've
00:16:57
got my background here that I generated
00:16:59
with mid Journey I've got a little
00:17:01
character that I generated in
00:17:03
leonardo.ai and then this background
00:17:05
texture here I generated with this tile
00:17:08
maker app by typing lava this isn't the
00:17:11
exact texture I'm using but that's how I
00:17:13
got the tech I put a white background
00:17:15
behind the scoreboard here so you can
00:17:16
actually read it I added a high score or
00:17:18
I made it so when the player is going to
00:17:21
the right they're facing the right when
00:17:22
they're moving to the left they face to
00:17:24
the left when they die and they fall in
00:17:25
the pit of lava it actually adds a reset
00:17:27
button I put a white border around all
00:17:30
of the platforms so that you can
00:17:32
actually see the platforms they were
00:17:33
kind of blending in with the background
00:17:34
a little bit too much I also added this
00:17:36
cool Parallax effect where you can see
00:17:38
the background move slower than the
00:17:40
foreground so it's not all moving at the
00:17:42
same Pace anymore kind of just gives it
00:17:44
a cooler more polished look and all of
00:17:46
that was just me going here's what I
00:17:47
want to do next and if it didn't work I
00:17:49
would just tell gpt4 that didn't work
00:17:51
what should I try that didn't work what
00:17:53
should I try I also kind of gave the
00:17:55
coin to spinning effect kind of more
00:17:56
looks like they're pulsating squeezing
00:17:58
than spinning but that's supposed to be
00:18:00
a coin spinning and that's as far as I
00:18:02
got I've also been trying to make the
00:18:04
character animate so the legs actually
00:18:06
like animate back and forth when they
00:18:08
move I've been spending hours and hours
00:18:10
and hours just trying to get GPT to make
00:18:12
the legs animate I have two images you
00:18:14
can see that there's one where it looks
00:18:16
like there's only one leg and one where
00:18:17
you can see both legs idea being if you
00:18:19
animate them back and forth it kind of
00:18:20
makes the character look like they're
00:18:21
walking I've been trying really really
00:18:24
really hard to get GPT to write the code
00:18:26
to make this animate so as the character
00:18:28
walks the legs look like they're moving
00:18:30
but so far after probably two hours or
00:18:34
so of going back and forth with GPT
00:18:36
saying that's not working here's my
00:18:39
entire code it's still not working what
00:18:41
do I need to fix next here's the entire
00:18:43
code what I need to fix next I still
00:18:45
have not gotten these legs to animate
00:18:47
properly when I'm on the platform they
00:18:48
don't move but we you can see when I'm
00:18:50
on the floor the legs actually move the
00:18:52
way they supposed to but it's already a
00:18:53
game over so I don't need the legs to
00:18:55
move with and on the floor I need the
00:18:56
legs moving on the platform so still
00:18:58
trying to debug this so it took a little
00:19:00
going back and forth but I finally got
00:19:01
it you can see my player actually
00:19:03
animates like they're walking when
00:19:04
they're on the platform now when they
00:19:06
jump in the air the animation stops like
00:19:08
it's supposed to it took me forever to
00:19:12
get that walking animation to finally
00:19:13
work here's what I did I pasted my
00:19:16
entire JavaScript code over here on the
00:19:18
left inside of the open AI playground
00:19:21
here I had to make sure that my maximum
00:19:22
length was set all the way to maximum
00:19:24
otherwise the code would cut off as it
00:19:26
was replying and then down here I put
00:19:28
here's the current JavaScript for my
00:19:30
game I'm running into a problem where
00:19:31
the player animation works when the
00:19:33
player is on the ground but the
00:19:34
animation does not work while the player
00:19:36
is on the platform what code do I need
00:19:38
to replace or add to fix this I found
00:19:40
that it's super helpful to give as much
00:19:42
context as possible when trying to solve
00:19:44
the problem so for example I wanted to
00:19:46
make sure it knew that the animation was
00:19:48
working when it was on the ground but it
00:19:50
wasn't working well on the platform if I
00:19:52
was just to put in the animation is not
00:19:54
working what do I do next it kept on
00:19:55
giving me solutions that weren't working
00:19:57
weren't working weren't working but when
00:19:58
I started to give it more context like
00:20:01
seems to work when I'm on the ground but
00:20:02
not while I'm on the platform then it
00:20:04
started to actually come to a conclusion
00:20:06
now we've got our little character
00:20:08
actually animating and walking while on
00:20:10
the platform like she's supposed to one
00:20:13
of the issues that I was running into
00:20:14
using the playground and gpt4 is there's
00:20:17
only so many characters it'll let you
00:20:19
generate before it makes you sort of
00:20:21
reset the whole thing so if I was to say
00:20:24
this finally works now I'd like the
00:20:28
character to explode in a fireball when
00:20:32
hitting ground how do I accomplish this
00:20:35
the model's maximum context length is
00:20:38
8192 tokens however you requested eight
00:20:40
thousand four hundred and five tokens
00:20:42
please reduce the length of your message
00:20:43
so I'm kind of stuck here I can't
00:20:45
continue so what I've had to do over and
00:20:47
over and over again is completely reset
00:20:49
playground here come over to my
00:20:51
JavaScript code copy the entire code
00:20:53
jump back into playground paste it into
00:20:55
the system box here make sure my maximum
00:20:57
length here is set all the way to the
00:20:58
top so it doesn't cut off while trying
00:21:00
to generate new code for me I've been
00:21:02
getting good results by setting the
00:21:03
temperature at six dead of seven for
00:21:05
whatever reason and then I'll type my
00:21:06
first prompt down here in the system box
00:21:08
so let's generate a little explosion
00:21:11
side of mid-journey and we'll use that
00:21:13
when the player hits the lava just just
00:21:15
for fun Imagine in Orange Fireball all
00:21:18
explosion let's add the word video game
00:21:21
in here all right so I kind of like this
00:21:22
one down here on the bottom right
00:21:24
upscale number four here I pulled it
00:21:26
into Photoshop real quick I'm gonna see
00:21:28
if I can get it more of a transparent
00:21:30
background now it doesn't have to be
00:21:31
perfect because you know it's kind of a
00:21:33
Cheesy quick game so that should do
00:21:35
let's go ahead and Export this as a PNG
00:21:38
and now I'm going to ask gpt4 how do I
00:21:41
add a flame explosion when my player
00:21:44
hits the lava I'd like to replace the
00:21:47
character with explosion PNG image when
00:21:51
the character hits the ground how
00:21:55
can I accomplish this now it's going to
00:21:58
give me some instructions it's going to
00:22:00
tell me what to copy and paste and I am
00:22:01
just going to follow the instructions
00:22:03
all right well I was waiting for the
00:22:04
code I just beat my own personal high
00:22:06
score at 227 so let's go see what code
00:22:09
it generated now it's copy and paste
00:22:11
time all right so I finally have my game
00:22:13
where my character is actually animated
00:22:15
when they walk when they die they die
00:22:18
with a fiery explosion
00:22:20
I'll probably add even more to it over
00:22:23
time but I think this is probably good
00:22:25
enough to show the capabilities of gpt4
00:22:28
without any coding experience whatsoever
00:22:30
so my final thoughts on this process
00:22:32
were it took a lot longer than I thought
00:22:34
it would I spent quite a bit of time
00:22:36
going back and forth with GPT saying
00:22:39
that didn't work what do I try next
00:22:40
copying and pasting all of the code back
00:22:42
inside of gpt4 playground giving it new
00:22:46
instructions of what I want it to fix
00:22:48
and just doing that process back and
00:22:49
forth and back and forth and just
00:22:51
copying and pasting literally not
00:22:52
changing any of the code myself now I
00:22:54
wouldn't say this was particularly
00:22:56
inexpensive I got to a point where I
00:22:58
couldn't use chat GPT anymore because
00:23:00
chat GPT kept on saying the message you
00:23:02
submitted was too long so I was no
00:23:04
longer able to just paste all of my code
00:23:05
in here luckily the gpt4 API instead of
00:23:08
playground allowed me to actually paste
00:23:10
longer text so I was able to kind of
00:23:12
continue on using playground but the
00:23:14
benefit of chat GPT is for the 20 a
00:23:17
month I could get 25 messages every
00:23:19
three hours as opposed to using tokens
00:23:23
with gpt4 if I come over here and I look
00:23:25
at my account I did end up spending a
00:23:27
little over twenty dollars with my gpt4
00:23:30
usage I mean still a lot cheaper than if
00:23:32
I was to hire a coder to do it myself
00:23:34
but you know not necessarily inexpensive
00:23:36
either also after going through this
00:23:38
process I no longer feel like I can say
00:23:41
I have no experience with coding
00:23:43
whatsoever this felt very much like
00:23:45
learning a language through immersion I
00:23:48
kept on saying that didn't work what do
00:23:49
I do next and it would give me new
00:23:51
JavaScript code and when it gave me new
00:23:53
JavaScript code it would explain what it
00:23:55
was fixing for example here in chatgypt
00:23:57
I explained an issue and it said create
00:24:00
a new variable to store the background
00:24:01
image outside of any functions just
00:24:03
after the canvas and then it gave me the
00:24:05
code and so after reading this
00:24:07
repeatedly over and over again with the
00:24:10
explanation of what I was doing adding
00:24:12
comments to the code like this is
00:24:13
telling me this is where I set the
00:24:14
background image source doing this
00:24:16
enough times I feel like I have a little
00:24:19
bit of a grasp of how the script works
00:24:21
now because of just this back and forth
00:24:23
not only did this build the game for me
00:24:25
but it also kind of taught me how to
00:24:28
code with JavaScript as I go now I
00:24:30
couldn't code anything from scratch
00:24:31
right now I wouldn't be able to start
00:24:32
with a blank screen and just start
00:24:34
coding but I do feel like if I was to
00:24:37
look at some JavaScript code and there
00:24:40
was issues and things weren't running I
00:24:42
would probably better be able to spot
00:24:44
some little issues this has been a super
00:24:45
helpful beneficial process not only to
00:24:48
create a game but also to learn
00:24:50
JavaScript I'm a little bit more
00:24:52
knowledgeable on it now so I know I had
00:24:54
to jump over some of the steps this was
00:24:56
literally about eight hours of recording
00:24:58
going back and forth with GPT so it
00:25:01
wouldn't have been too exciting to show
00:25:02
you every little step I did just know I
00:25:05
didn't go in and change any code myself
00:25:06
everything I did was copying and pasting
00:25:09
and asking chatgpt what to do next and I
00:25:12
got this game out of it all of the
00:25:14
images were generated with AI the
00:25:16
background the little character the lava
00:25:18
even when the player dies that little
00:25:20
explosion was created with AI as well so
00:25:23
pre-cool process and I'm excited to go
00:25:25
and make more games I want to take it to
00:25:28
another level I want to try to make a
00:25:30
game using Unity or Unreal Engine now
00:25:33
and see if I can go to another level and
00:25:34
make something maybe even more 3D or a
00:25:37
much more in-depth game this is a really
00:25:39
basic sort of casual game where you just
00:25:42
keep on going and try to beat your high
00:25:43
score I think it'd be really cool to try
00:25:45
to develop something a little more in
00:25:46
depth and see how much gpt4 and these
00:25:49
various AI tools can help me get there I
00:25:52
will link to this game if you actually
00:25:53
want to try to play it yourself I'll put
00:25:55
the link Down Below in the video
00:25:56
comments and you can check this game out
00:25:59
and if you really enjoyed nerding out
00:26:00
about all of this cool AI stuff with me
00:26:02
head on over to featuretools.io this is
00:26:04
where I curate all the cool tools that I
00:26:06
come across click this button to join
00:26:07
the free newsletter every single Friday
00:26:08
I'll send you an email with my five
00:26:10
coolest tools that I came across a
00:26:12
handful of news articles handful of
00:26:14
YouTube videos and one cool way to make
00:26:15
money with AI it goes out every Friday
00:26:16
it's the tldr of the week in Ai and I
00:26:19
really think you'll dig it thanks so
00:26:20
much for tuning in if you enjoyed this
00:26:21
video maybe give it a thumbs up and
00:26:23
subscribe to this channel if you want to
00:26:24
see more videos like it in your feed
00:26:25
alright really appreciate you thanks
00:26:27
again see you next one bye
00:26:29
[Music]

Description:

Here's a breakdown of how I used AI to make a video game. Here's the game: https://mreflow.com/jump-game/ GitHub: https://github.com/mreflow/AI-Jump-Game 🛠️ Explore hundreds of AI Tools: https://www.futuretools.io/ 📰 Weekly Newsletter: https://futuretools.beehiiv.com/subscribe 😊 Discord Community: https://discord.com/invite/WBk4ZDW6A9 🐤 Follow me on Twitter: https://twitter.com/mreflow 🐺 My personal blog: https://www.mattwolfe.com/ 🌯 Buy me a burrito: https://ko-fi.com/mattwolfe 🍭 My Backgrounds: https://www.futuretools.io/desktop-backgrounds Outro music generated by Mubert https://mubert.com/render

Preparing download options

popular icon
Popular
hd icon
HD video
audio icon
Only sound
total icon
All
* — If the video is playing in a new tab, go to it, then right-click on the video and select "Save video as..."
** — Link intended for online playback in specialized players

Questions about downloading video

mobile menu iconHow can I download "Using AI To Build A Game From Scratch (NO Experience)" video?mobile menu icon

  • http://unidownloader.com/ website is the best way to download a video or a separate audio track if you want to do without installing programs and extensions.

  • The UDL Helper extension is a convenient button that is seamlessly integrated into YouTube, Instagram and OK.ru sites for fast content download.

  • UDL Client program (for Windows) is the most powerful solution that supports more than 900 websites, social networks and video hosting sites, as well as any video quality that is available in the source.

  • UDL Lite is a really convenient way to access a website from your mobile device. With its help, you can easily download videos directly to your smartphone.

mobile menu iconWhich format of "Using AI To Build A Game From Scratch (NO Experience)" video should I choose?mobile menu icon

  • The best quality formats are FullHD (1080p), 2K (1440p), 4K (2160p) and 8K (4320p). The higher the resolution of your screen, the higher the video quality should be. However, there are other factors to consider: download speed, amount of free space, and device performance during playback.

mobile menu iconWhy does my computer freeze when loading a "Using AI To Build A Game From Scratch (NO Experience)" video?mobile menu icon

  • The browser/computer should not freeze completely! If this happens, please report it with a link to the video. Sometimes videos cannot be downloaded directly in a suitable format, so we have added the ability to convert the file to the desired format. In some cases, this process may actively use computer resources.

mobile menu iconHow can I download "Using AI To Build A Game From Scratch (NO Experience)" video to my phone?mobile menu icon

  • You can download a video to your smartphone using the website or the PWA application UDL Lite. It is also possible to send a download link via QR code using the UDL Helper extension.

mobile menu iconHow can I download an audio track (music) to MP3 "Using AI To Build A Game From Scratch (NO Experience)"?mobile menu icon

  • The most convenient way is to use the UDL Client program, which supports converting video to MP3 format. In some cases, MP3 can also be downloaded through the UDL Helper extension.

mobile menu iconHow can I save a frame from a video "Using AI To Build A Game From Scratch (NO Experience)"?mobile menu icon

  • This feature is available in the UDL Helper extension. Make sure that "Show the video snapshot button" is checked in the settings. A camera icon should appear in the lower right corner of the player to the left of the "Settings" icon. When you click on it, the current frame from the video will be saved to your computer in JPEG format.

mobile menu iconWhat's the price of all this stuff?mobile menu icon

  • It costs nothing. Our services are absolutely free for all users. There are no PRO subscriptions, no restrictions on the number or maximum length of downloaded videos.