Making a Game with Java with No Experience

Goodgis
5 Aug 202408:40

Summary

TLDRيحكي النص عن مغامرة博主 في تعلم لغة برمجة جافا وتطبيقها في إنشاء لعبة رول العبيدي (RPG) من الصفر. بدأ من تجربته المبكرة مع الكتابة البرمجية وفشله في ذلك، وتطور إلى المحاولة النهائية لبناء لعبة جافا باستخدام IDE مثل Eclipse. يتضمن النص تعليمات لبناء برمجة بسيطة، واستخدام جافا لإنشاء إطارات ورسم مخططات، ودمج الصوت والرسومات. وأظهر ال博主atisfaction بلغة جافا وتشجيع المشاهدة على سلسلة الدروس لتعلمها.

Takeaways

  • 😀 Java هي لغة برمجة جذابة وملهمة، تم إنشاؤها لتكون قابلة لإعادة التشغيل في أي نظام تشغيل.
  • 🕹️ الألعاب الشهيرة مثل RuneScape وMinecraft تم إنشاؤها باستخدام Java.
  • 📚 في سن الستة عشرة، حاولت تعلم Java من كتاب يسمى 'برمجة ألعاب الفيديو لشرير الخبيث' لكن فشلت في ذلك.
  • 📱 بعد مرور خمس عشر عام، حاول تعلم Java من خلال دورة على الهاتف لفهم صيغتها.
  • 💻 استخدمت IDE باسم Eclipse لبرمجة Java، وهو أكثر البرمجيات شعبية مقارنة بIDE أخرى مثل NetBeans.
  • 👋 لقد قمت بإنشاء أول برنامج بلغة Java، وهو بسيط وينبغي أن يطبع 'Hello World'.
  • 🎮 أردت إنشاء لعبة角色扮演 (RPG) قديمة، مشابهة لألعاب NES مثل 'Dragon Quest'.
  • 🖼️ استخدمت Java لرسم نافذة (frame) للعبة، وأنا قادر على إنشاء لعبة مبنية تمامًا على Java التقليدية.
  • 👾 أنشأت فئات جديدة للعبة مثل 'entity' و 'player' لإعادة استخدام الشفرة في الشخصيات الغير الحية (NPCs).
  • 🛠️ تعلمت كيفية إنشاء خريطة المربعات (tile map) ونظام الكاميرا لتحسين أداء اللعبة.
  • 🎨 استخدمت أدوات الرسم البياني (Pixel Art) لتحسين لون لوحة اللعب وتصميم الشخصيات.
  • 🔊 أضفت الصوتيات والموسيقى للعبة، وقمت بإنشاء نظام توقف (pausing state) لعرض الحالة والمخزون.
  • 🌍 أضفت خريطة العالم ونظام الانتقال بين المدن والعالم الخارجي للعبة.

Q & A

  • ما هي اللغة البرمجة التي تجذب الشخص الذي يتحدث في النص؟

    -لغة برمجة جافا (Java) هي التي تجذب الشخص الذي يتحدث في النص.

  • لماذا يرى جافا كلغة برمجة لذيذة الصوت؟

    -الشخص يرى جافا كلغة برمجة لذيذة الصوت لأنها كانت اللغة التي تم بناء الألعاب الشهيرة مثل رون سكيب (RuneScape) وماين كرافت (Minecraft) بها.

  • ما هي الميزة الرئيسية للغة برمجة جافا التي تميزها عن اللغات الأخرى؟

    -الميزة الرئيسية للغة برمجة جافا هي أنها تتيح للمبرمجين الكتابة مرة وتشغيل الكود في أي مكان (write once, run everywhere)، مما يعني أن الكود جافا يعمل تلقائيًا على أنظمة تشغيل أخرى بدون إعادة ترجمة.

  • متى تم إطلاق لغة برمجة جافا للمرة الأولى؟

    -تم إطلاق لغة برمجة جافا لأول مرة في عام 1995.

  • لماذا توقف الشخص عن المحاولة في تعلم جافا عندما كان يبلغ من العمر 12 عامًا؟

    -الشخص توقف عن المحاولة في تعلم جافا عندما كان يبلغ من العمر 12 عامًا لأنه أصبح مزعجًا بعد قراءته للجزء الأول من كتاب "برمجة الألعاب الإلكترونية للشرير الخبيث" ومحاولة نسخ الكود.

  • ما هو IDE الذي تم استخدامه في النص لبرمجة بلغة جافا؟

    -IDE الذي تم استخدامه في النص لبرمجة بلغة جافا هو إكليس (Eclipse).

  • ما هي الخطوات التي اتبعها الشخص لإنشاء برنامج 'hello world' بلغة جافا؟

    -الخطوات التي اتبعها الشخص لإنشاء برنامج 'hello world' بلغة جافا هي إنشاء حزمة (package) وتسميتها 'Main'، ثم إنشاء فئة (class) وتسميتها 'main'، وأخيرًا إدخال الكود 'System.out.println("hello world")'.

  • ماذا يقصد الشخص بـ 'RPG' في النص؟

    -RPG في النص يشير إلى لعبة تقمص الأدوار (Role-Playing Game)، وهي نوع من الألعاب الإلكترونية التي تتضمن تفاعل اللاعب مع عالم خيالي وتتضمن تطور الشخصية والتفاعل مع الشخصيات غير اللاعبة.

  • لماذا يرى الشخص أن تصميم لعبة RPG بدون محركات لعبة هو ممتع ومثير؟

    -الشخص يرى تصميم لعبة RPG بدون محركات لعبة هو ممتع ومثير لأنه يشعر بالإنجاز والرضا عندما يبني شيئًا من الصفر ويكون على علم أنه هو الذي قام ببناء اللعبة بنفسه.

  • ما هي المصادر التي ينصح بها الشخص لتعلم جافا؟

    -الشخص ينصح بسلسلة الدروس التي قام بها ري نوف (rynow) وبرنامج تعليمي برينتل (Brilliant) لتعلم البرمجة.

Outlines

00:00

🤖 Java Game Development Journey

The script begins with the narrator's fascination with Java, a programming language they find both delicious-sounding and historically significant in game development, citing RuneScape and Minecraft as examples. They recount an early attempt to learn Java from a library book, 'Programming Video Games for the Evil Genius,' which ended in frustration. Fast forward 15 years, the narrator embarks on a quest to redeem themselves by creating a game using Java. They start by taking a refresher course on Java syntax via a mobile app, then move on to using Eclipse IDE, a popular choice for Java development. The first project is a classic 'Hello World' program, followed by the ambitious goal of creating an old-school RPG inspired by NES games like Dragon Quest. The script details the initial steps in game development, including setting up a JFrame for the game window, creating entity and player classes, and implementing basic sprite movement.

05:01

🎨 Crafting an RPG with Java: Art and Sound

The second paragraph delves into the artistic and auditory aspects of game development. The narrator discusses the challenges of creating vector art for the game, eventually opting for pixel art to capture the quirky charm of classic RPGs. They mention using a pixel art software that doubles as a level editor by exporting tiles as text files. Moving on to sound, the narrator experiments with LabTur, generating various sound effects and crafting music with Beatbox, a new experience for them. They also introduce a pausing state system for inventory and stats viewing, and create a rudimentary world map to test room transitions between towns and the overworld. The addition of NPCs using the previously established entity system is highlighted, along with a dialogue system that allows characters to interact. The paragraph concludes with the narrator's intention to save combat mechanics for a future video, reflecting on the rewarding experience of building a game from scratch without a game engine and expressing their enjoyment of working with Java. They recommend RN's tutorial series for those interested in Java and promote Brilliant.org for interactive learning in various fields, including programming.

Mindmap

Keywords

💡Java

Java هو لغة برمجة مشهورة بقوتها وشموليتها، تم إنشاؤها ل容许程序员编写一次代码后在不同的操作系统上运行无需重新编译,它是视频主题中讨论的主要编程语言,用来创建视频游戏中的RPG。

💡RuneScape وMinecraft

RuneScape وMinecraft هما ألعاب تفاعلية مشهورة تم إنشاؤها باستخدام Java، وهما مثال على التطبيقات التي يمكن للغة Java إنشاءها، مما يظهر القدرة القوية للغة Java في تطوير الألعاب.

💡برمجة الألعاب

البرمجة العاب هي فرع من علوم البرمجة يستخدم لإنشاء ألعاب الفيديو، و视频中提到 الشخص يتعلم Java لبرمجة لعبة جديدة، مما يظهر الهدف الإبداعي والمهني للشخص في الفيديو.

💡IDE (بيئة تطوير متكاملة)

IDE هي بيئة توفر الأدوات اللازمة لكتابة وتحرير وتشغيل الكود، Eclipse هي مثال على IDE مخصصة للغة Java، و视频中 يستخدمها الشخص لتطوير مشاريع Java.

💡Hello World

Hello World هو برنامج بسيط يطبع النص 'Hello, World!' ويعد أول خطوة في تعلم أي لغة برمجة، و视频中 يستخدم كمثال لبدء تعلم Java.

💡RPG (Rôle-Playing Game)

RPG هي نوع من الألعاب تفاعلية تتضمن اللاعبون في قصة ودوريات متعددة، و视频中 يتحدث الشخص عن رغبته في إنشاء لعبة RPG قديمة وجميلة بأسلوب أصلي.

💡jframe

jframe هي فئة في Java ت容许 إنشاء إطارات ونوافذ للألعاب، و视频中 يستخدمها الشخص لإنشاء إطار للعبة RPG التي يطورها.

💡Sprite

Sprite هي الصورة المستخدمة لتمثيل الشخصيات أو الكائنات في الألعاب، و视频中 يستخدمها الشخص لتحميل وتحريك الشخصيات في لعبه.

💡Tile Map

Tile Map هي واجهة تتكون من مربعات تمثل الأماكن المختلفة في الألعاب، و视频中 يستخدمها الشخص لإنشاء الخريطة للعبة.

💡Pixel Art

Pixel Art هي أسلوب رسوم يستخدم بكسل اللون لإنشاء الرسومات، و视频中 يستخدمها الشخص لتصميم الشخصيات والخرائط في لعبه.

💡Soundtrack

Soundtrack هي الموسيقى والأصوات التي ت容許 تعزيز التجربة الجميلة في الألعاب، و视频中 يستخدمها الشخص لإضافة موسيقى وأصوات للعبة.

Highlights

Java's 'write once, run anywhere' capability is highlighted as a key feature.

The speaker's childhood interest in Java was sparked by video games.

A past attempt to learn Java at age 12 was abandoned due to frustration.

A Java course on a mobile device was taken to refresh the speaker's knowledge.

Eclipse IDE was chosen for Java development over NetBeans.

Creating a 'Hello World' program in Java was the first step in the project.

The ambition to create an RPG game was inspired by classic NES titles.

Java's built-in JFrame was used to create a game window.

The creation of entity and player classes for code reusability is discussed.

A tutorial series by rynow was found to be very helpful for understanding Java game development.

A tile map system was created using a text file and array.

A camera system was implemented to move the tileset instead of the player.

Artwork for the game was updated to a pixel art style inspired by NES games.

Pixel art was used for game assets, and a pixel art software feature was used for level editing.

Sound effects and music were created using LabTur and Beatbox.

A pausing state system was created for inventory and stats viewing.

A world map was designed and a room transition system was implemented.

NPCs were added to the game using the entity system for ease.

A dialogue system was implemented for NPC interactions.

The speaker finds creating games without a game engine rewarding despite the challenges.

The speaker highly recommends RN's tutorial series for those interested in Java game development.

Brilliant.org is promoted as a learning platform for programming and other subjects.

The speaker's website, gus.fun, is mentioned for more information and content.

Transcripts

play00:00

Java has always fascinated me not only

play00:02

is it the most delicious sounding

play00:04

programming language I've ever heard but

play00:05

some of my favorite childhood games like

play00:07

RuneScape and Minecraft were made using

play00:09

it it was created to let programmers

play00:11

write once and run everywhere meaning

play00:13

Java code automatically works on other

play00:15

operating systems without having to

play00:16

recompile which is truly a beautiful

play00:18

thing and ever since it's release in

play00:21

1995 it has remained one of the most

play00:23

popular programming languages needless

play00:25

to say I've been anxious for a long time

play00:27

to try it out and see what I can do with

play00:29

it now I must confess when I was 12

play00:31

before I even made video games I went to

play00:33

my local library and picked up this book

play00:35

called programming video games for the

play00:37

Evil Genius a pretty cheesy name for a

play00:39

book that was just about learning Java

play00:41

of course after skim reading a chapter

play00:43

or two and trying to copy the code I

play00:45

quickly became frustrated and completely

play00:47

gave up so fast forwarding almost 15

play00:49

years later I think it's time for me to

play00:51

redeem myself and see if I can actually

play00:53

make a game from scratch using Java not

play00:55

scratch I mean Java you get you get what

play00:57

I'm saying so starting off on my Java

play00:59

Quest I did something that I haven't

play01:01

done in a while and that was actually

play01:02

taking a little Java course on my phone

play01:05

and by take a course I mean I just kind

play01:07

of did a couple levels to get a feel for

play01:08

what the syntax was like and honestly if

play01:10

you're a beginner or new to programming

play01:12

languages uh I feel like this is just

play01:14

like a good thing to do it just kind of

play01:15

gives you a general idea before you just

play01:17

start jumping into it anywh who after I

play01:19

was done getting familiar with the

play01:20

basics I downloaded Eclipse which is an

play01:22

IDE and just in case you don't know what

play01:24

that is it's basically just software

play01:26

that you use to code in but this one's

play01:28

specifically for Java and I seem to

play01:29

remember using an IDE called net beans

play01:31

as a kid but Eclipse seems a lot more

play01:33

popular now so I just figured I would go

play01:35

with the crowd after that I set off to

play01:37

create a simple hello world program

play01:39

which was pretty straightforward

play01:40

basically you just create a package and

play01:43

I named it Maine and then you create a

play01:44

class and I also called it main I know

play01:46

it's confusing just trust me on it after

play01:48

that I slapped in the classic system out

play01:50

print line hello world and there you go

play01:53

your first Java program I did it so

play01:55

after getting my feet wet I knew I was

play01:56

ready to start working on my real

play01:58

project instead of CR a little mini game

play02:00

like I normally do for these kinds of

play02:02

videos I want to do something I've been

play02:03

dreaming about for a while now and

play02:05

that's making an RPG and I'm not talking

play02:07

about rocket launchers here I mean like

play02:08

an old grindy RPG that you would play on

play02:11

the NES games like Dragon Quest and

play02:13

Earthbound Beginnings I don't know why

play02:15

but I find these games simplistic art

play02:16

style super strange characters and

play02:19

repetitive combat to be so Charming they

play02:21

always feel so empty yet so full of

play02:23

character at the same time so now we

play02:24

know what direction the game's going to

play02:26

take it's time for us to do something

play02:27

basic and that's just draw a window and

play02:30

no I'm not talking about getting out a

play02:31

box of crayons and drawing a house with

play02:32

a window I'm talking about that frame

play02:34

that you see on your desktop when you

play02:36

play a game luckily for us Java has its

play02:38

own built-in container class called

play02:39

jframe meaning our game can be built

play02:41

purely with Vanilla Java so I set up

play02:43

jframe and made some of the parameters

play02:45

any who after doing all that I was able

play02:47

to successfully draw a window and as you

play02:49

can tell I was very excited next I

play02:51

created two new classes entity and

play02:53

player I'm planning on making NPCs later

play02:55

on so creating an entity class allows me

play02:57

just to reuse that code for the player

play02:59

and NPC for example like drawing their

play03:02

Sprites or checking for collisions and

play03:04

speaking of Sprites I was able to load

play03:06

and draw the Sticky's image make a move

play03:08

around the screen so yay I should also

play03:10

point out that I found this wonderful

play03:11

tutorial series by rynow and it was

play03:13

beyond helpful he does a really good job

play03:15

explaining how all this works so if you

play03:17

want to know more about the nitty-gritty

play03:19

details and all the code definitely

play03:20

check it out next I want to dive into

play03:22

creating a tile map system this is

play03:24

something that has always been

play03:25

intimidating for me for some reason it

play03:27

turns out to be super easy essentially

play03:28

all you have to do is create a text file

play03:30

full of numbers the numbers represent

play03:32

different types of tiles like zero is

play03:34

water and like one is grass and two is

play03:36

sand then all you need to do is load the

play03:38

data into an array and then slap it into

play03:40

a for Loop boom you got yourself a tile

play03:42

map and that's great and all but how do

play03:44

you make a camera system so that the

play03:45

player like can move around a larger

play03:48

tile ma area well the trick is instead

play03:50

of moving the player you move the tile

play03:52

set after that I made an if statement to

play03:54

see what tiles were on screen that way I

play03:56

could save performance by only rendering

play03:58

what the player could see and last I

play04:00

created collisions so you couldn't just

play04:02

like walk on the water so there you go

play04:04

now as you can tell the artwork is

play04:05

looking a little rough around the edges

play04:07

and since 50% of RPGs is just artwork I

play04:10

felt like we probably should update this

play04:12

now my original idea was to create a

play04:14

vector art style inspired by Byron be's

play04:17

Pokemon world map illustrations I've

play04:18

been a big fan of his work for a while

play04:20

and thought an RPG could look Super

play04:21

Fresh in this style though I quickly

play04:23

realized that higher resolution Vector

play04:25

artwork wasn't going to scale well down

play04:27

into pixels so this led me to kind of

play04:29

just create this same style but using

play04:31

pixel art instead I thought the results

play04:32

of this were kind of cool but I

play04:34

personally felt like this missed that

play04:35

quirky charm that I wanted to emulate in

play04:37

my favorite NES RPGs so after a slightly

play04:40

iterative process and the use of the NES

play04:42

color palette I ended up with this my

play04:44

animal inspired RPG so with that done I

play04:47

got to work replacing and adding in all

play04:49

the new tiles and artwork I also found

play04:51

that pixel edit the pixel art software I

play04:53

use has a feature that lets you export

play04:55

tiles out as a text file essentially

play04:57

turning my art software into my level

play04:59

editor which was pretty sweet after this

play05:01

I felt like the sound aspect of the game

play05:03

needed to be addressed so I jumped into

play05:04

lab tur I generated a couple of

play05:06

different sounds and then added them to

play05:07

the game I especially love this door

play05:09

sound when you enter a house it just

play05:11

It's oddly satisfying for music I made

play05:13

it myself using beatbox which I haven't

play05:15

used before I was surprised how easy it

play05:17

was to pick up but uh my song's a little

play05:19

clunky so let me know what you think

play05:20

after that I created a pausing State

play05:22

system so you can eventually look at

play05:24

your inventory and view your stats and I

play05:26

also Drew this text onto the screen so

play05:28

that text is actually a font I also know

play05:30

that world maps are a pretty big deal in

play05:32

these types of RPGs so I jumped back

play05:34

into pixel edit and made this kind of

play05:36

smaller world map just as a test run to

play05:38

see how I liked it this also means I had

play05:39

to create a room transition system so

play05:41

you could go from towns to the Overworld

play05:44

right now there's only one town but I

play05:46

think it's it's pretty cool it's start

play05:47

starting to feel like an RPG at this

play05:49

point I knew it was probably time to add

play05:51

NPCs I mean they're such a critical part

play05:53

using that entity system I mentioned

play05:55

earlier was super easy and made adding

play05:57

these NPCs take no time at all and then

play05:59

I add a dialogue system so I could have

play06:02

Bears say weird things like this and

play06:04

with that we have a basic RPG structure

play06:07

we're still missing combat which is the

play06:08

most crucial part of the game but I want

play06:10

to save that for a future video because

play06:12

this was a project I just really enjoyed

play06:15

working on I can't explain it but making

play06:17

a game without a game engine is super

play06:19

satisfying it's difficult and

play06:21

frustrating especially when you know you

play06:23

could do it 10 times faster using

play06:24

something else but it's also really

play06:26

rewarding cuz you know that you made it

play06:28

yourself I have a lot of plans what I

play06:29

could do with this RPG in the future

play06:31

even just as a passion project please

play06:33

let me know if you like to see more of

play06:34

it if not I'll probably just continue to

play06:36

work on it on my own time overall I

play06:38

really enjoy Java I think this has

play06:40

probably been my favorite language I've

play06:41

used so far in this series I highly

play06:43

highly recommend you check out RN's

play06:45

tutorial series on Java it's

play06:46

unbelievably helpful it explains

play06:48

everything that I covered in this video

play06:50

pretty much and even if you're just

play06:51

mildly interested check it out also if

play06:54

you're wanting to learn how to code

play06:55

yourself and you don't know how to get

play06:56

started check out a word from today's

play06:58

sponsor brilliant okay you might know

play07:00

this by now but brilliant is where you

play07:01

learn by doing with thousands of

play07:04

interactive lessons in math data

play07:05

analysis programming and of course AI

play07:08

now one thing I really like about it is

play07:10

brilliant helps build your critical

play07:11

thinking skills through problem solving

play07:13

not memorization so while you're

play07:15

building real knowledge on specific

play07:17

topics you're also becoming a better

play07:19

thinker brilliant is a learning platform

play07:20

designed to be uniquely effective each

play07:22

lesson is filled with Hands-On problem

play07:24

solving that can let you play with

play07:25

Concepts a method proven to be six times

play07:28

more effective than just watching boring

play07:30

lecture videos plus all the content on

play07:32

brilliant is crafted by an award-winning

play07:34

team of teachers researchers

play07:35

professionals from MIT Caltech Duke

play07:38

Microsoft and learning a little every

play07:40

day is one of the most important things

play07:41

you can do for both your personal and

play07:43

professional growth brilliant helps you

play07:45

build real knowledge in minutes a day

play07:47

with fun lessons you can do whenever you

play07:49

have time it's basically the opposite of

play07:51

mindlessly scrolling which is a

play07:52

beautiful thing now if you want to start

play07:54

programming brilliant has a growing

play07:56

number of programming courses that are a

play07:57

great way to start building foundational

play07:59

programming skills and learn real world

play08:01

applications get familiar with python

play08:03

and start building programs on day one

play08:05

with a drag and drop editor learn

play08:06

essential coding elements things that

play08:08

everyone should know like loops and

play08:09

variables and most importantly develop

play08:11

your mind to actually think like a

play08:13

programmer to try everything brilliant

play08:15

has to offer for free for a full 30 days

play08:17

visit brilliant.org goodus or click the

play08:20

link in the description you'll also get

play08:22

uh 20% off annual premium subscription

play08:24

so check it out also I just want to give

play08:26

my website a shout out gus. fun check it

play08:28

out it's got some information on there

play08:30

latest videos and a picture of me wow

play08:33

let me know if there's any other coding

play08:34

challenges you want me to tackle in the

play08:35

future and I'll see you next time

Rate This

5.0 / 5 (0 votes)

Etiquetas Relacionadas
تطوير الألعابجافاRPGتصميم الشخصياتخرائط الألعابتجربة البرمجةتعليم جافابرمجة بصريةتحدي البرمجةبرمجة من الصفر
¿Necesitas un resumen en inglés?