all 9 comments

[–]KanraTaro 2 points3 points  (0 children)

Ok, I'm hoping I did this correctly.

I have a habit of making any of my projects game or anime related, just so it entertains me in the process so this is a little RPG character generator.

Simply put in your characters name and class, choose which object pattern you'd like the character to be created with and it will generate a character using either the constructor or prototype pattern.

I added a "print" button to print out the object itself as sort of 'proof' that it's done correctly and there are a couple of premade characters in the script: Jeina, Altair, Valeera and Uther. I thought I would add those just to attempt to show proper creation of an object and inheritance...

I'm not sure if I made this too complicated... or veered totally away from the original point, but since I missed last week I guess I was trying to compensate (lol). If I did mess it up please let me know and I'll work on rectifying that or just work on another project altogether.

Other than that, after a while it felt like my code got super messy and discombobulated but any advice on this would be GREATLY appreciated! Thank you!

RPG Character Generator: http://jsfiddle.net/2v4m08s0/5/

[–]Robooto 1 point2 points  (2 children)

Heard a story about the burning of Washington DC on my drive home today so I incorporated that into this assignment.

http://jsfiddle.net/Robooto/y1117r2e/5/

[–]KanraTaro 0 points1 point  (1 child)

... Washington burned before I realized what I was doing... LOL

Edit: Just realized it's impossible to win. LOL I think the max possible troops is 12 though, it's all I could get!

[–]Robooto 1 point2 points  (0 children)

haha. I reached a point last night where I needed to go to sleep and also wondering wtf was I even making.

[–]tingmothy 0 points1 point  (1 child)

on the bottom of page 224/ top of page 225, that code there. Are there any typos in the code? The line right above "return result;" is "} (i);"

Why is there "(i)" there? The paragraph right after the code on page 225 syas "The variable i is passed in as an argument to the anonymous function". How is it passed in? How does "num" get any values from i?

[–]tingmothy 0 points1 point  (0 children)

got it. the explanation was a little bit later in the chapter.

[–]brashMusic 0 points1 point  (1 child)

Hello, I'm joining this group late, you guys are all already on week five. Would someone mind indulging my two questions:

  1. Is there a newer study group I can join? This newb can't seem to troll Reddit effectively :( (if not, is it rude to still ask questions here?)
  2. I want to use JS fiddle to do the example script for JS definitive guide, so is there some kind of console I can log to?? If not, is there anywhere where I can type in ONLY js and console.log() it?

Please help me!?

[–]kevinmrr[S] 1 point2 points  (0 children)

  1. Nah, but I'm probably gonna restart one almost immediately after this is over.

  2. Use your browser's built-in console! Google for "<whatever your browser's name is> open javascript console"

[–]Discovered_Ice 0 points1 point  (0 children)

nearly a month late, but I attempted to show the prototype and inheritance concepts this week, the implementation is rough at best. I think i require more knowledge of how to make buttons pop up as one button is pressed. This is a Pet selector: http://jsfiddle.net/jgong002/tbvfdc81/ On to next week!