help with my scrolling beat em up !!UPDATED!!

Started by
16 comments, last by lodoss118 17 years, 7 months ago
ok thanks, and in DXUMoveSprite(&sprite, x, y + (z/2)); ?
Advertisement
Quote:Original post by lodoss118
sorry wats wrong with getSpriteTorender? it basically tells the renderManager wat sprite to render i.e STANCE = setSpriteToRender(getStance()); etc.

basically i haven't implemented jump but what your saying by introducing the z i was wondering how the move method would look like?


There is nothing wrong with SpriteToRender. Yours is SprtieToRender :) Just a typo.

As to your jump system, it is really just a matter of implementing it. Your sort code shouldnt make a difference, or for the most part even need to be called.
Yeah, thats the one.

It's basically a case of seperating the 'behaviour' from the 'drawing'. So, the moving the characters closer or further from the camera does nothing more than alter their Z component. When it comes to the drawing, seeing as you want to be able to show the Z component, you do so by adding it to the Y value when drawing (albeit trimmed a little). That way, as people move further away from the camera, they slide up slowly.


Actually, just thinking about it, you'll probably want to trim it by more than half if you really are doing something similar to Double Dragon as the suggested angle is quite shallow. Try dividing it by 4, maybe even 5.


Hope it all works out.
thanks guys hopefully i will get it done by this week will post screenshots soon, thanks again :). I am just a beginner always failing but never gived up and now i am slowly getting there: )/
http://rapidshare.de/files/33825071/zOrder.avi.html

ok i done the z implement seems it works. Just need to add jump. Check the video out, although it seems from the video that leo (lion guy) seems to draw behind another char abit early as his feet r still abit lower any fixes?
Wow, some nice looking graphics there. You do them yourself?

Anyway, without seeing any source it's hard to determine what is causing the Leo character to overlap. All I can do is suggest a few potential areas...

1. Check there is no negative value on the characters Y axis. This would obviously mean his feet are technically 'in' the ground and would result in him begin displayed lower than he should, despite being Z-sorted fine.

2. Check all the sprites feet line up with their actual location on the Y axis. Assuming their location values represents their feet. Perhaps the Leo character is drawn slightly higher in his bitmap image than the other characters, this will have an effect. You need to very methodical about how you draw your sprites and make rules such as "The feet will always be touching the bottom of the bitmap image and I will draw with this position at their world coordinates."

3. Simply check the sorting method. Although it would appear it's probably one of the other two as he is sorting properly, just slightly out.


Hope that helps.
the sprites have been stolen from mugen chars, just testing out the engine with them. THe leo char is scaled abit larger (i think) and thats what is cauing the problem i am sure i can think of something to fix not a biggy.

king leo inherits from character

#ifndef KINGLEO_H#define KINGLEO_H#include "Character.h"class KingLeo : public Character{public:		KingLeo();		~KingLeo();		void load(int type);};#endif#include "KingLeo.h"KingLeo::KingLeo():Character("LEO", PLAYER, 700){	load(1);	setAlive(true);	setScaleX(2.5);	setScaleY(2.9);	setPosX(400);	setSpeed(5.8);}KingLeo::~KingLeo(){}void KingLeo::load(int type){	stance = new AnimatedSprite(20, 0.26, 1, 0, 0);	stance->addImage(0, "Data\\Characters\\King Leo\\Stance\\stance 01.bmp", 255, 0, 255);	stance->addImage(1, "Data\\Characters\\King Leo\\Stance\\stance 02.bmp", 255, 0, 255);	stance->addImage(2, "Data\\Characters\\King Leo\\Stance\\stance 03.bmp", 255, 0, 255);	stance->addImage(3, "Data\\Characters\\King Leo\\Stance\\stance 04.bmp", 255, 0, 255);	stance->addImage(4, "Data\\Characters\\King Leo\\Stance\\stance 05.bmp", 255, 0, 255);	stance->addImage(5, "Data\\Characters\\King Leo\\Stance\\stance 06.bmp", 255, 0, 255);	stance->addImage(6, "Data\\Characters\\King Leo\\Stance\\stance 07.bmp", 255, 0, 255);	stance->addImage(7, "Data\\Characters\\King Leo\\Stance\\stance 08.bmp", 255, 0, 255);	stance->addImage(8, "Data\\Characters\\King Leo\\Stance\\stance 09.bmp", 255, 0, 255);	stance->addImage(9, "Data\\Characters\\King Leo\\Stance\\stance 10.bmp", 255, 0, 255);	stance->addImage(10, "Data\\Characters\\King Leo\\Stance\\stance 11.bmp", 255, 0, 255);	stance->addImage(11, "Data\\Characters\\King Leo\\Stance\\stance 12.bmp", 255, 0, 255);	stance->addImage(12, "Data\\Characters\\King Leo\\Stance\\stance 13.bmp", 255, 0, 255);	stance->addImage(13, "Data\\Characters\\King Leo\\Stance\\stance 14.bmp", 255, 0, 255);	stance->addImage(14, "Data\\Characters\\King Leo\\Stance\\stance 15.bmp", 255, 0, 255);	stance->addImage(15, "Data\\Characters\\King Leo\\Stance\\stance 16.bmp", 255, 0, 255);	stance->addImage(16, "Data\\Characters\\King Leo\\Stance\\stance 17.bmp", 255, 0, 255);	stance->addImage(17, "Data\\Characters\\King Leo\\Stance\\stance 18.bmp", 255, 0, 255);	stance->addImage(18, "Data\\Characters\\King Leo\\Stance\\stance 19.bmp", 255, 0, 255);	stance->addImage(19, "Data\\Characters\\King Leo\\Stance\\stance 20.bmp", 255, 0, 255);	stance->setSprite();	walk = new AnimatedSprite(14, 0.32, 1, 0, 20);	walk->addImage(0, "Data\\Characters\\King Leo\\Walk\\walk 01.bmp", 255, 0, 255);	walk->addImage(1, "Data\\Characters\\King Leo\\Walk\\walk 02.bmp", 255, 0, 255);	walk->addImage(2, "Data\\Characters\\King Leo\\Walk\\walk 03.bmp", 255, 0, 255);	walk->addImage(3, "Data\\Characters\\King Leo\\Walk\\walk 04.bmp", 255, 0, 255);	walk->addImage(4, "Data\\Characters\\King Leo\\Walk\\walk 05.bmp", 255, 0, 255);	walk->addImage(5, "Data\\Characters\\King Leo\\Walk\\walk 06.bmp", 255, 0, 255);	walk->addImage(6, "Data\\Characters\\King Leo\\Walk\\walk 07.bmp", 255, 0, 255);	walk->addImage(7, "Data\\Characters\\King Leo\\Walk\\walk 08.bmp", 255, 0, 255);	walk->addImage(8, "Data\\Characters\\King Leo\\Walk\\walk 09.bmp", 255, 0, 255);	walk->addImage(9, "Data\\Characters\\King Leo\\Walk\\walk 10.bmp", 255, 0, 255);	walk->addImage(10, "Data\\Characters\\King Leo\\Walk\\walk 11.bmp", 255, 0, 255);	walk->addImage(11, "Data\\Characters\\King Leo\\Walk\\walk 12.bmp", 255, 0, 255);	walk->addImage(12, "Data\\Characters\\King Leo\\Walk\\walk 13.bmp", 255, 0, 255);	walk->addImage(13, "Data\\Characters\\King Leo\\Walk\\walk 14.bmp", 255, 0, 255);	walk->setSprite();}
ok i going to implement the jump method but not sure how to do the jump where u have two heigh jumps one low and one high according how long the user presses the button for, wats the easiest way to do it.

This topic is closed to new replies.

Advertisement