Joined: February 28th, 2013, 3:23 amPosts: 2844Location: Oklahoma, United States

I love urban dictionary, without it I'd be stuck asking about this new newfangled internet speak every few posts from chili et al. I had to look up TL;DR before as well, though I'm guessing it's not new.

Dictionary.com wrote:

First recorded in 2000-05; from its use in digital communications

_________________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

Also, I was thinking of buying this book , because I have 33 $ that I get to buy a book with, and I was struggling with how game patterns work (Tile-based systems, basic fighting games, and I dunno I have 33 bucks on amazon why not use it ). https://www.amazon.com/dp/0990582906Just checking in here to find out if this book is ok and also asking if I should buy hardcover (for 33 bucks) or kindle version. Just something else I noticed, those customer reviews are shady, all these 5 stars o.O.

Something else, I seem rather scatter-brained. I need more words to express random stuff. (Just look at how many times I use "Also, just, by the way")

For the Changelog!Pre-Delta (Because I looked up Greek Alphabet in Google)

Currently have a "MyVec2" class that I can work on to learn about vectors

I've made a User and Entities class that can interact with eachother. (Needs refinement) (Entity or better said Enemy is currently a red square)

Added Sprite/Animation Support (Thanks Albinopapa, be sure to check out his post on it)

Added some Sprites, still needs everything in the spoiler. Missing Sprites are replaced by white currently. (Not in Albino's version):

West-Running animation

SouthWest-Running animation

NorthWest-Running Animation(And the mirrors of these, but that doesn't take long)

Added a State Machine (again, thanks Albinopapa for the help)

I shouldn't forget to list what's upcoming either:

Add Albino's new stuff to the game.

Add the remaining sprites

Add Sprites so that I can kill Entities

Add the Tower in the middle that is going to be attacked by Entities (Sprites & Class)

Change the Entites class to have an Attack Priority (make sprites for them then too)

Make different types of Entites (more enum classes? Or am I overdoing this )

Add the wave-based stuffAnd there's a lot more I can add to this, luckily

Quick question here, too:If I want to have multiple swords for the character (or atleast open the possibility for that) should I have a sword class (with an enum class in it for which type) and have either a separate animation for each sword where the user uses it or one animation for the user that is swinging its hands holding no sword and draw a sword animation ontop of that.

Joined: February 28th, 2013, 3:23 amPosts: 2844Location: Oklahoma, United States

Zedtho wrote:

If I want to have multiple swords for the character (or atleast open the possibility for that) should I have a sword class (with an enum class in it for which type) and have either a separate animation for each sword where the user uses it or one animation for the user that is swinging its hands holding no sword and draw a sword animation ontop of that.

If the swords are going to behave differently, then have different sword classes through polymorphism, or use the enums if you aren't ready for polymorphism. If the swords are going to behave the same, but have different data, then just create a struct for each sword type, and pass the active type to a function in sword or sword constructor. If it's just different sprites with no behavior change and no value changes, load all the sprites for all the swords, create a current sword sprite pointer, and when the user changes swords, assign the address of one of those preloaded sprites to the current sword pointer.

Make the animations for the character and sword separate. You'll still have to draw the different sword animations, but not the character. The other way, If you have 5 swords, you'd have to draw the 8 directions for the charcter for standing, running and fighting times the 5 different swords, minus the three mirrord versions I supoose.

Just to give you a reference, the sprite class and alphasprite class in my project do practically the same thing and I could have used an enum to determine which PutPixel function to call, but they DO have different behavior for their drawing, so I made them different classes with the common stuff in the parent class.

The AnimationController class has the same behavior and can display either solid or transparent sprites, depending on which type were loaded into the frames object passed in. And in Frames, that's why I made the Frames::SpriteType enum, so I didn't have to make separate alphaframes and solidframes classes, they both would have the exact same behavior.

I'm going to try the same approach for the Particles I've been working on for a couple of days.

NOTE: Before you buy the book, check out the link in my tag, Game Programming Patters. There is an online version you can read through and see for yourself if it's worth buy the hard back version or not. I've looked through it quite a few times over the past year, and have found it informative and it's a nice read. The explanations of how to use the different design patterns is clear, and the examples are nice, it's probably just me, but there's not enough depth for grasp the patterns just by reading it. I'm have to practice the crap out of it to get it to sink in. Not the authors fault, I'm sure most people get it the first few times.

Some patterns are easier to understand; Game Loop and Update are both things you're already doing. The strategy pattern ( or close to it ), is pretty much the style that chili has been using for teaching.

_________________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

It's been a while! Nothing new yet, just working on the structure of the code atm. Got a question, though. I've been trying to figure out how to make a keyboard input switch, something like:switch(VectorOfAllKeyboardInput) //For statement to loop through all of the currently pressed keys{case W:case A://etc....

}

Im mainly here to ask if: 1. Its worth making a switch or I should just use an if tree 2. How to do it if its worth it

You can't switch on the keyboard state because it's not a single integral value. It is essentially a container full of bools.

If you want to run your logic by looking at the current state of keys that are down, use ifs with KeyIsPressed (polling-based input). If you want your game to respond to discrete keyup and keydown events, use a switch with ReadKey() (event-driven input; see papa's example above).

They have their strengths and weaknesses, but generally an event-driven model will give you more flexibility and control.

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