Tag Info

New answers tagged

0

I finally found the solution! Draw the enemies with respect to the map's position! Just draw the map, and then the entities on top of it a certain distance away from the map's top-left corner. This way, no matter how the map's position changes, the entities will stay put because they're drawn based on where the map is. The player is drawn on top of ...


1

Don't have the damage reduction be additive, have it multiplicative. Damage = Damage * (1.0 - helmetReduction) * (1.0 - gloveReduction) * (1.0 - trousersReduction) * (1.0 - upperArmorReduction) Each layer of armor reduces not the complete damage, but the damage remaining from the previous layer. As long as no single ...


1

Think ease of use. You always have to start with what you want to achieve first. And it can all be made simple - I want the weakest unit to kill the weakest player with 20 hits. I want the strongest unit to kill the strongest player with 10 hits. The rest is just curving the increments between them. You can build any game on these two considerations ...


1

You'll need to create some way to control the damage passing through. For example: light armor has a maximum reduction of 75%, medium 85% and heavy 95%. If the total reduction combined is above the number, use that value instead. You could also create a weighed reduction: say the player wears one heavy, two medium and one light piece of armor: ...


3

You could reduce the damage for each piece individually. That way you never reach 0 unless a piece reduces it by 100%. You can get very low though. You could also make the different pieces never total 100%. Helmet max 15% torso max 20% arms max 10% legs max 10% Max damage resistance would be 55% like that. You could also go with a much more refined ...


0

I think it would make the most sense to use percentage based reduction, if you don't want to remove damage entirely. For example different pieces could provide different percentages of damage reduction: Helmet - 5% Gloves - 5% Chest - 15% Legs - 10% Total reduction = 35% Then for example if your character is hit for 40 points of damage you would do the ...


0

Your constrain function seems to be flipped. You call m.constrain(p); which is going to call: // stops 'obj' from leaving 'this' (except that you shouldn't be setting variables of *this*) this.constrain = function(obj) { if(this.x > obj.x) { this.x = obj.x;} if(this.y > obj.y) { this.y = obj.y;} if(this.x + this.width ...


0

Collision detection shouldn't depend on input. You should aim to make your movement and collision systems as generic as possible. Not only that but I'm seeing an issue with the logic that happens during your frame. You seem to be doing something along the lines of: //Detect input //Detect collision //Move according to facing direction //Draw ...


2

Mixing perspectives is very uncommon and, at least in your example, is bad because the perspective of the foreground (buildings in front of the river) do not match those in the background. There is one notable game that uses mixed perspectives: Zelda: A Link to the Past If you look carefully, there is no single vanishing point. The corner walls ...



Top 50 recent answers are included