Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

2D All the way! / 2D questions - RPG elements

Author
Message
kkun
14
Years of Service
User Offline
Joined: 10th Jun 2009
Location:
Posted: 24th Aug 2009 16:52
Hey all,
i've been writing up a document and have been making plans for a project i would like to work on. While writing it i had a few things going through my mind as how will i do this or how will i program that and such. If anyone can enlighten me it would help me a lot.

1.When you do damage to an enemy, numbers appear above the head. How would you do those numbers? Sprite it or is there a better way because i dont really want to sit there spriting numbers 1 to however much damage i want to do.

2. When changing weapons in a game, how would i do the sprites. Should i a) do sprites of the character holding each weapon in every direction or b) make 2 sprites. 1 for the character and one for the item. so all i have to do is switch the item sprite. BIG EXCEPTION. would that mean i would have to make 2 different sprites for 2 handed weapons because i need overlays for the items. eg having like the weapon in the second hand further away from you. lets say the assassin has 2 daggers. the one closer to us is on the left hand. and the one on the right is closer to the back.

i think thats it for the time being until i run into something else
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 24th Aug 2009 21:12 Edited at: 24th Aug 2009 21:29
A1: you'll want to develop a system that uses or combines numbers 0-9 to form any number you could want to display (and since it's an rpg, you'll probably included all letters and symbols such as exclamation points, questions marks, quotes, etc, for dialogue). while you could use the built-in text commands to do this, most utilize a "bitmap font" system such as this by Scraggle. check the post for how to use them as well as a variety of bitmap fonts he's created and served up for the community.

A2: the short answer is B and, yes, you'll be doing separate 1-handed, 2-handed weapon & character sprites (unless you cheat (aka, be very efficient) and combine them both. ie, if you draw your sprites so they can be used for both 1 and 2 handed weapons (and what about carrying a shield? ).

with that, as a rule, you'll do well to create a variety of sprite sheets that all conform to a base template of your character(s) so you could mix and match clothing, armor, hair styles, accessories, weapons, etc, thus providing variety and distinction with relative ease. see this chibi site for an example of how this would work, and you could click the banner in my sig to see those sprite sets in action in the game Jimpo is working on.

the chibi website might be a little difficult to negotiate but click some of the links to pull up various sprite sets and notice how the clothes, armor, etc, are added (in layers) to the base character sheet to generate semi-custom sprites.


kkun
14
Years of Service
User Offline
Joined: 10th Jun 2009
Location:
Posted: 24th Aug 2009 21:40
Thank you for that very quick reply Nomad. Especially for the link to the bitmap font, though i'm unsure as how to use it at the moment im sure i would pick it up soon.

Since i saw your Dego ad sig, i've tried it and i think its pretty awesome. I notice there are a few things in the game that would answer some of my questions that pop up in my mind. Ones that make me go, "wait i need that, how do i do it"

One thing i haven't actually worked out properly ( not in my game but through other random coding) is the knock back of sprites. EG. My character does a critical hit, and knocks back the enemy however distance. I can't get my head around how i work out the code to do that.

Lets say im on the right side, the enemy is on the left and i knock him back because im attacking from the right side. How would i go about doing that if i was on the left? Would that be two different functions or is there and actual way to determine that?

It's just like an ability i've been trying to work out. BACKSTAB. Standing behind an enemy deals more damage? I've searched and tested code and its just making me tear my hair out.
Grog Grueslayer
Valued Member
18
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 24th Aug 2009 21:59
You can just use the TEXT command to write the damage over the character with a small delay so the text is seen more than one sync. There's no need to make them sprites.

If your character is facing right you paste the left weapon image first, then paste the characters sprite, then paste the right weapon image. That way the left weapon is behind the character every time. Of course if your character is facing right you do the opposite (right weapon, character, left weapon). You only need the character as the sprite for collision... leave the weapons just images. Also make sure to hide the characters sprite so it isn't seen on top of all the pasted images.

kkun
14
Years of Service
User Offline
Joined: 10th Jun 2009
Location:
Posted: 25th Aug 2009 10:22
@ Grog
I dont like the text just appears on top. It is a bit plain for me.

And yes i am using that way of pasting my sprites. As for collsion thats a different thing entirely for me. Should i be making the items stick to my main sprite or and i coding them so they stick to my sprites xyz positions.
kkun
14
Years of Service
User Offline
Joined: 10th Jun 2009
Location:
Posted: 29th Aug 2009 05:11
If there are others that are reading this post,

are there any good 2d tile tutorials? From making a tileset map maker to actually describing how to implement them or describe what to do with them?

I dont know where to start and what they actually do yet i need them.
The other tutes either help with one or the other but theres no explanations as good as zenessmans but he ended his tute and its imcomplete.
Ovan35
14
Years of Service
User Offline
Joined: 25th Sep 2009
Location:
Posted: 28th Sep 2009 10:22
I am a newb at this so sorry if my idea might be out of place but as far as your monster being knocked back on critical hits sounds like you would define what a critical hit is first in your code.Like if you made it where a critical hit is when damage exceeds 5% of the character max hp.Then make a if statement that causes the x position value of the enemy to decrease or increase by a certain amount (depending on how far you want your enemy to slide and in which direction when hit)

As far as how to get your program to tell whether you're hitting from left or right.Sounds like another if statement.This one would probablly be better suited to the enemies code.If enemy.x position > hero.x position then your hero is on the left of the monster.
If the enemy.x position < hero.x position then your hero is on the right.I would love to hear anyone elses idea on this one..Because I wanted to make a rpg myself eventually.

Login to post a reply

Server time is: 2024-04-28 07:43:27
Your offset time is: 2024-04-28 07:43:27