Register    Login    Forum    Search    FAQ

Board index » Everything




Post new topic Reply to topic  [ 627 posts ]  Go to page Previous  1 ... 56, 57, 58, 59, 60, 61, 62, 63  Next
Author Message
 Post Posted: September 20th, 2017, 1:04 am 
Site Admin
User avatar

Joined: December 31st, 2011, 4:53 pm
Posts: 3448
Location: Japan
No branches, only dreams now.

Each tutorial has important commits tagged (usually the end of the tutorial commit). You just create a branch at the commit you're interested in, using the tags as guideposts.

_________________
Chili


Top 
 Profile  
Reply with quote  
 Post Posted: September 20th, 2017, 4:57 pm 
User avatar

Joined: January 19th, 2017, 10:28 pm
Posts: 487
Location: Idiot from northern Europe
Yeah figured it out :)

Had nothing to do at school today so watched 10, 11 and 12. Just watched them through without pausing to get the idea. Found these really interesting so decided just watching through them once and then watch each of them more carefully would be a good idea.

rewatched 10, didn't code along because I wanted to make it more of a challenge afterwards. But cheated a bit by writing down a guideline which I peaked at while coding. Will try to do it all over again without the guideline before moving on to 11.

guideline
Spoiler:
surface class -
array of colors (pixels)
width and height
cpy cstr and copy assignment
putpixel
getpixel
getwidth/height
constructor

in gfx:
drawsprite()

include chiliwin to get access to bitmapfileheader and info

in the constructor:
read in the fileheader
read in infoheader
assert bitcompression == BI_RGB

set width/height and load pixels in array

bfOffBits is where the offset from beginning of file to where the pixel data starts

padding = (4 - (width * 3) % 4) % 4

_________________
I just like to thumb my nose at millionaires.
If I was rolled I'd bust them heads up.


Top 
 Profile  
Reply with quote  
 Post Posted: September 20th, 2017, 7:57 pm 
User avatar

Joined: January 19th, 2017, 10:28 pm
Posts: 487
Location: Idiot from northern Europe
Success!

Took a break for a few hours before trying to write the code without any cheating. Took the break so everything wouldn't be superfresh in my mind and me just remembering exactly what I needed to do. This way I had to think a bit more what I needed.

Decided to record it because 1. I'm a nerd and enjoy watching speedcoding and 2. I felt like recording it helped me not get tempted to cheat.

here's me doing the "challenge" in 8x speed.

https://www.youtube.com/watch?v=z-vtupqvbFI

will have a closer look at 11 and maybe 12 tomorrow unless I get a bunch of school stuff to do.

_________________
I just like to thumb my nose at millionaires.
If I was rolled I'd bust them heads up.


Top 
 Profile  
Reply with quote  
 Post Posted: September 21st, 2017, 2:31 pm 
Site Admin
User avatar

Joined: December 31st, 2011, 4:53 pm
Posts: 3448
Location: Japan
11, 12, and 13 (maybe not 13) should be a bit of deja-vu for you considering that you had this stuff in your Shoot-Em-Up balls game. Though it's nice to see exactly where all that Surface and sprite routine comes from and the entire process of its creation, isn't it? :)


The timelapse coding looks cool, music suits!

14 is gonna teach how to make your own template classes and template functions. Good shit.

_________________
Chili


Top 
 Profile  
Reply with quote  
 Post Posted: September 21st, 2017, 3:48 pm 
 

Joined: February 28th, 2013, 3:23 am
Posts: 2782
Location: Oklahoma, United States
chili wrote:
11, 12, and 13 (maybe not 13) should be a bit of deja-vu for you considering that you had this stuff in your Shoot-Em-Up balls game. Though it's nice to see exactly where all that Surface and sprite routine comes from and the entire process of its creation, isn't it? :)


The timelapse coding looks cool, music suits!

14 is gonna teach how to make your own template classes and template functions. Good shit.


Are you going to cover template specialization?

_________________
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


Top 
 Profile  
Reply with quote  
 Post Posted: September 21st, 2017, 8:31 pm 
User avatar

Joined: January 19th, 2017, 10:28 pm
Posts: 487
Location: Idiot from northern Europe
chili wrote:
11, 12, and 13 (maybe not 13) should be a bit of deja-vu for you considering that you had this stuff in your Shoot-Em-Up balls game. Though it's nice to see exactly where all that Surface and sprite routine comes from and the entire process of its creation, isn't it? :)


The timelapse coding looks cool, music suits!

14 is gonna teach how to make your own template classes and template functions. Good shit.


Yes and no. The thing with sprite sheets and just drawing parts of the picture was new to me.
Also back then I didn't really understand how to animation class worked, just used it.

Glad you liked the timelapse because I made an other one! haha. This one is long and nobody should watch it unless they're bored and have too much time on their hands or are into the music.

I had nothing to do so made another challenge to do everything from loading bitmaps to animated sprites without cheating. Had a little trouble along the way but went alright, took a bit more than 2 hours.
Don't worry, these recordings wont become a regular thing :lol: (probably last one)
https://www.youtube.com/watch?v=awTOLUh2raI

Will watch 13 tomorrow, then do maths for a while

_________________
I just like to thumb my nose at millionaires.
If I was rolled I'd bust them heads up.


Top 
 Profile  
Reply with quote  
 Post Posted: September 22nd, 2017, 1:14 am 
Site Admin
User avatar

Joined: December 31st, 2011, 4:53 pm
Posts: 3448
Location: Japan
albinopapa wrote:
chili wrote:
11, 12, and 13 (maybe not 13) should be a bit of deja-vu for you considering that you had this stuff in your Shoot-Em-Up balls game. Though it's nice to see exactly where all that Surface and sprite routine comes from and the entire process of its creation, isn't it? :)


The timelapse coding looks cool, music suits!

14 is gonna teach how to make your own template classes and template functions. Good shit.


Are you going to cover template specialization?


Not in the introduction to templates. Information overload is seldom a good thing ;)

_________________
Chili


Top 
 Profile  
Reply with quote  
 Post Posted: September 22nd, 2017, 10:10 am 
User avatar

Joined: December 15th, 2012, 2:18 pm
Posts: 18
Yumtard wrote:
Success!

Took a break for a few hours before trying to write the code without any cheating. Took the break so everything wouldn't be superfresh in my mind and me just remembering exactly what I needed to do. This way I had to think a bit more what I needed.

Decided to record it because 1. I'm a nerd and enjoy watching speedcoding and 2. I felt like recording it helped me not get tempted to cheat.

here's me doing the "challenge" in 8x speed.

https://www.youtube.com/watch?v=z-vtupqvbFI

will have a closer look at 11 and maybe 12 tomorrow unless I get a bunch of school stuff to do.


Hey, I noticed that around 1:00 in that clip you wrote assignment operator. What happens when you do the following:

Surface a ("anyfilename.bmp");
a = a;

The universe will blow ^^

Check this: https://isocpp.org/wiki/faq/assignment-operators

Btw: I love your idea about not being tempted to cheat!


Top 
 Profile  
Reply with quote  
 Post Posted: September 22nd, 2017, 10:19 am 
Site Admin
User avatar

Joined: December 31st, 2011, 4:53 pm
Posts: 3448
Location: Japan
Chrajdal wrote:
Yumtard wrote:
Success!

Took a break for a few hours before trying to write the code without any cheating. Took the break so everything wouldn't be superfresh in my mind and me just remembering exactly what I needed to do. This way I had to think a bit more what I needed.

Decided to record it because 1. I'm a nerd and enjoy watching speedcoding and 2. I felt like recording it helped me not get tempted to cheat.

here's me doing the "challenge" in 8x speed.

https://www.youtube.com/watch?v=z-vtupqvbFI

will have a closer look at 11 and maybe 12 tomorrow unless I get a bunch of school stuff to do.


Hey, I noticed that around 1:00 in that clip you wrote assignment operator. What happens when you do the following:

Surface a ("anyfilename.bmp");
a = a;

The universe will blow ^^

Check this: https://isocpp.org/wiki/faq/assignment-operators

Btw: I love your idea about not being tempted to cheat!


Yeah I mention that case on the wiki page. Should have covered it in the tutorial but forgot about it!

_________________
Chili


Top 
 Profile  
Reply with quote  
 Post Posted: September 22nd, 2017, 10:52 am 
User avatar

Joined: January 19th, 2017, 10:28 pm
Posts: 487
Location: Idiot from northern Europe
interesting! Never considered self assignment

_________________
I just like to thumb my nose at millionaires.
If I was rolled I'd bust them heads up.


Top 
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
 
Post new topic Reply to topic  [ 627 posts ]  Go to page Previous  1 ... 56, 57, 58, 59, 60, 61, 62, 63  Next

Board index » Everything


 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for: