Noob learns to code in 3 months

The Partridge Family were neither partridges nor a family. Discuss.
Post Reply
User avatar
Yumtard
Posts: 575
Joined: January 19th, 2017, 10:28 pm
Location: Idiot from northern Europe

Re: Noob learns to code in 3 months

Post by Yumtard » February 3rd, 2017, 2:09 am

Day 8

Since I didn't take it easy yday I took it easy on the programming today. Just made a title screen.
When I was a kid, games always had awesome looking pics on the covers or in the title screen and then the actual game looked like shit. So I wanted to do a throw back to that.
Unfortunately I'm not artistic, can't draw, can't really photoshop etc. but i took a pic of a spaceship from google and then made stars in after effects, added some effects and a lens flare and followed a tutorial on how to make planets.
Actually came out better than I expected :) Wish I knew how to draw well and use illustrator etc though.

http://i.imgur.com/GZDs2DQ.png

Also rewatched episode 18.

Here's the plan for the weekend.

Friday:
episode 19 of new series,
episode B16 and B17 of the old series
Take notes and do home works

Saturday:
B19-B21
Take notes and do home works

Sunday:
i01-i02
Take notes and do homeworks
If I have time then change all the graphics of space balls to get rid of all the putpixel calls.

Then on monday Hopefully start working on enemy ships :)

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: Noob learns to code in 3 months

Post by chili » February 3rd, 2017, 3:45 am

albinopapa wrote:Yeah bro, you might be ready to look into loading images and memory allocations.

Check out chili's old tuts, somewhere around the beginner series lessons 16-17,19-21 and intermediate lessons 1 and 2

B16 -> Pointers
B17 -> Strings
B19 -> File access (read/write)
B20,B21 -> Loading bmp files ( B21 has a bug fix from B20) and load and render font sheets

I01 -> Memory management: Memory allocation on the heap and deallocation ( chili will show you an easier way for memory management in the new series )
I02 -> Using Windows GDI+ to load other image formats like .png

These 7 videos will take probably about 13 hours to watch, but they are worth it. You'll be able to get rid of all those PP calls and drastically reduce the compile time as well as the size of your code AND should make VS a lot more responsive.
Papa has given you a good list of stuff to review.

The old stuff can be rough at places. I think the I01 tut is kinda garbage (i introduce OOP there kinda ham-handedly). Pointers lesson is good stuff. Strings prolly okay too. What you can do is, skip the bmp loading, and just go for GDI+. I will cover loading BMP again in the reboot and it will be better, but what you need right now is just to do the thing. so...

B16 -> Pointers
B17 -> Strings
I01 -> Memory management part mainly, other stuff about classes you can skim / skip (prolly already know most of it
I02-> GDI+ loading

Then, if you wanna look into rendering strings / text:
B21

== edit ==

B20 might contain some info on actually drawing the sprites (Blitting), so you might wanna check that out too... You can skim the parts about loading bmp from file tho.

=======


The title page graphic is lookin good mate. Def watching T19 before the Old series stuff, you might get some ideas you want to incorporate in your spaceballs engine (or you might wanna save that for your next project).
Chili

User avatar
Yumtard
Posts: 575
Joined: January 19th, 2017, 10:28 pm
Location: Idiot from northern Europe

Re: Noob learns to code in 3 months

Post by Yumtard » February 3rd, 2017, 1:38 pm

Thanks chili! I'm gonna follow this guide for the weekend :)

Got an idea for a function to draw lasers. So made a quick version of it. Will probably use it for the end boss. Will change the constants to variables and change some other stuff when I get there

Image

Code: Select all

void Game::DrawLaser()
{
	int x = 200;
	int y = 100;
	gfx.DrawSquare(x, y, 10, 200, Colors::White);
	int g = 55;
	for (int i = x - 21; i < x; i++)
	{
		for (int j = y; j < y + 200; j++)
		{
			gfx.PutPixel(i, j, 0, g, 0);
		}
		g += 10;
	}
	g = 255;
	for (int i = x + 10; i < x + 30; i++)
	{
		for (int j = y; j < y + 200; j++)
		{
			gfx.PutPixel(i, j, 0, g, 0);
		}
		g -= 10;
	}
}

Edit: made g loop all the way down to 5 which made the edges look better

User avatar
Yumtard
Posts: 575
Joined: January 19th, 2017, 10:28 pm
Location: Idiot from northern Europe

Re: Noob learns to code in 3 months

Post by Yumtard » February 3rd, 2017, 11:12 pm

just watched episode 19....twice. Feel like some of it went over my head. Will prob get back to it again later and follow along changing spaceballs

Just having a bit of a hard time understanding why we want to code this way since it feels like a harder way to do the same thing

User avatar
Yumtard
Posts: 575
Joined: January 19th, 2017, 10:28 pm
Location: Idiot from northern Europe

Re: Noob learns to code in 3 months

Post by Yumtard » February 4th, 2017, 12:41 am

I feel very stupid after episode 18. Started feeling like I might not have the brain power to get good at programming at this age.
Opened up b18 of the old series, noticed it was 2 hours long and started procrastinating by trying to make a function that draws a laser ball since I thought I might use it for the tip of the laser beam.
Took some button clicking and was much harder than the straight beam but eventually got decent results. Probably a dumb stupid written fucntion though.

Image


Anyways! I've felt this way tons of time when studying poker but kept going :) Gonna watch the tutorial now *flex*

albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: Noob learns to code in 3 months

Post by albinopapa » February 4th, 2017, 2:48 am

Man, I can't wait until you get the image loading stuff in, I can't even compile this thing anymore, I keep running out of memory.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

User avatar
Yumtard
Posts: 575
Joined: January 19th, 2017, 10:28 pm
Location: Idiot from northern Europe

Re: Noob learns to code in 3 months

Post by Yumtard » February 4th, 2017, 2:59 am

albinopapa wrote:Man, I can't wait until you get the image loading stuff in, I can't even compile this thing anymore, I keep running out of memory.
haha sorry, still works for me, guess the title screen was a bit too much.

Anyways started watching the b18 of old series. After 10 minutes I was like "Damn you past chili! Why don't you make sense at all!? final form Chili usually makes sense" Then i realizes I was supposed to watch b16 and b17 and not b18.
So watched b16 about pointers. Was interesting and everything made perfect sense, wp past Chili.
Watching b17 right now

User avatar
Yumtard
Posts: 575
Joined: January 19th, 2017, 10:28 pm
Location: Idiot from northern Europe

Re: Noob learns to code in 3 months

Post by Yumtard » February 4th, 2017, 1:24 pm

Watched i02
Nope, don't get it.

albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: Noob learns to code in 3 months

Post by albinopapa » February 4th, 2017, 1:43 pm

Which parts?
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

User avatar
Yumtard
Posts: 575
Joined: January 19th, 2017, 10:28 pm
Location: Idiot from northern Europe

Re: Noob learns to code in 3 months

Post by Yumtard » February 4th, 2017, 2:05 pm

albinopapa wrote:Which parts?
About the first 3 hours of it.

No but seriously, first he went through binary and hexadecmal. I felt like I understood some of it. Then it got to programming. Chili seemed to be using stuff I don't have like D3DGraphics, Sprite, Bitmap.cpp and whatnot. He made a function to load a sprite with alpha but already had a LoadSprite and basically I just didn't understand anything that was going on

Post Reply