Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Despairy

Pages: [1]
1
yeah that is the right coordinate system.

and yeah the colors are like meaningless :P
but its like golden axe when jumping it changes  the Z coordinate

could use an idea ;) ty

2
if there are no jumping theres no need for Z movement ( unless you speak of falling)
well I need to declare floors and rectangles and make a collision detection with them
anyhow i have a simple idea of figuring out the distance of the character from the bottom point of the floor
and if i hit another floor i need to have around the same distance.... problem is from jumping from small
area to larger ( or opposite ) that this calculation wont be good enough...

ill make more photoshops if it might help u help me ;)
ty

3
I'm not so sure about how to implement the jumping functions .

obviously I have the x and y cordinates on the screen
once the user jumps i need to DEcrease the y coordinate only for the sprite to go up for jumping
but I need to change it as the Z coordinate since walking up is decreasing the y coordinate aswell.

 i thought of saving the old Y coordinate before jumping and check for FLOORs collision with the same old Y
but if i jump from one surface to another i need to know where to land on the Y coordinate

added an amazing photoshopped picture , hope you understood what i meant :)

thanks

[attachment deleted by admin]

4
Thought of Golden Axe game
but not sure how to do 2.5d .

would appreciate good ideas :)

thanks

5
didnt know that ... O_O thanks

6
hi i tried to make a tetris polygon
the FLIPPED L shape and this is what i get


http://imageshack.us/photo/my-images/38/goodab.gif

if you see the points are inserted in the right order
top left
top right
bottom right
bottom middle
middle middle
middle left

for some reason the shape is all messed up
any ideas? debugging showed the points are inserted well and i HAVE NO CLUE!

thanks!

7
Graphics / SFML and multi shapes.
« on: March 20, 2012, 07:18:34 pm »
I was wondering if there is a way adding multiple rectangles into
one sf::Shape object.

for instance i would like to make a Tetris brick using rectangles
can i do it?

8
Graphics / Sprites Collision- how to stop them from moving?
« on: January 20, 2012, 04:25:06 pm »
aiiiiiiiiight changed to the events like you said.
now its moving almost smoothly... just need to play with the configurations

thanks alot!
if anyone needs the code you can PM me

9
Graphics / Sprites Collision- how to stop them from moving?
« on: January 18, 2012, 09:40:32 pm »
thanks but thats one of the things i tried.
float remaining=32;
while (remaining>0)
{
     ...move(xx*elapsedtime,yy*elapsedtime)
     remaining-=abs(xx*elapsedtime,yy*elapsedtime)
}

something like that ... and it still moves like teleporting
instead of smooth moving...

i have one more idea to try hope it'll work...
though i will appreciate a few other ideas.

thanks! good day.

10
Graphics / Sprites Collision- how to stop them from moving?
« on: January 18, 2012, 07:19:41 am »
i gave up the collisions i just try to fix the smooth movement.

the problem is that i use a matrix to control the game.
so each movement ( +1 spot on matrix) should be 32 pxs exactly in the
game window.

from what i understand I HAVE to use elapsedTime in order to
get a smooth movement. but move (xx*elapsedTime,0) wont move
32 pxs... actually when i tried it the character moved around 2 pxs until
the matrix character got to the end of the matrix (instead of 640 pxs)

any ideas?
( in short : i need on getInput/getEvent left to move -32 pxs to the left)
( but SMOOTHHHHHHHHH)

thanks again

11
Graphics / Sprites Collision- how to stop them from moving?
« on: January 16, 2012, 06:36:23 pm »
exactly ... how do i do that?
i want everytime the user press RIGHT BUTTON to move +32 px on the
x axis. move(+32,0) isnt good.
how else should i write this ?
thanks!

12
Graphics / Sprites Collision- how to stop them from moving?
« on: January 14, 2012, 08:09:33 pm »
Finally I went for 2d matrix holding the gameobjects.
now the next step is being checked instead of the whole drawable objects.

but now I have graphic issues.
since i saved all of the objects in a matrix i have a canMove() function
that checks if the next move is legit.
if so the sprite moves to that direction (32b) but it jumps to it instead of
smoothly going there.
i thought of using the elapsedtime option but i have no idea how to use it
so the matrix checks will keep happening while pressing.

well here is the code, hope you can help me figure out what to do ty!!!

   
Code: [Select]
[quote]
while(App.IsOpened())
{
while(App.GetEvent(event))// quit or switch players
{

if (event.Type == sf::Event::Closed)// close program
App.Close();
if (App.GetInput().IsKeyDown(sf::Key::Escape))
App.Close();
if ((event.Type == sf::Event::KeyPressed)&&
(event.Key.Code == sf::Key::P))// switch players
i++;
if (i==_moveables.end())
i=_moveables.begin();
}

if (App.GetInput().IsKeyDown(sf::Key::Left)) // move left
if ((**i).canMove(-1,0,_world))
(**i)._sprite.Move(-32,0);
if (App.GetInput().IsKeyDown(sf::Key::Right))
if ((**i).canMove(+1,0,_world))
(**i)._sprite.Move(+32,0);
if (App.GetInput().IsKeyDown(sf::Key::Up))
if ((**i).canMove(0,-1,_world))
(**i)._sprite.Move(0,-32);
if (App.GetInput().IsKeyDown(sf::Key::Down))
if ((**i).canMove(0,+1,_world))
(**i)._sprite.Move(0,+32);
App.Clear(); // clear window
drawStuff(App);// draw all drawable vector.
App.Display(); // display
[color=red]Sleep(24); // for not moving too fast[/color] // do i need this?
xMove=0;yMove=0;
[/quote]


sorry quote and code arent working O_O

13
Graphics / Sprites Collision- how to stop them from moving?
« on: January 14, 2012, 01:16:33 pm »
Thanks for the reply.

1. if I have a game board of size 20*20 , wont I have to check that one
    character with ALL of the others with every movement?

2. until now I was holding the moveable characters in a moveables vector
    and drawable objects in drawable vector.
    What if I will hold the entire world in a matrix ( in addition to the vectors)
    will than the collision detector from (1) will be simpler to handle?[/b]

14
Graphics / Sprites Collision- how to stop them from moving?
« on: January 14, 2012, 01:00:52 pm »
Hi, i have a couple of question about using sfml graphics :
first:
lets say i have a world of objects ( walls and characters )
how do i get the character to stop walking if it encounters a wall?

( but the character can move on different things like trees )

second : the world of objects is being handles using a matrix of [20][20] size
            how can i use the sfml for moving while corollated with the matrix?
            if i can do that i can just check the cells and answer  the first Q

would apperciate your help thanks!

Pages: [1]
anything