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.


Topics - TioMOG

Pages: [1]
1
Graphics / [Help] An Isometric Movement Code
« on: October 26, 2014, 09:34:22 pm »
Hey, guys!

You guys helped me in the last topic I made for a help in collision for my isometric race game (this one), and I thank you very much :D

But now I'm getting stuck by this one problem, that is implementing a acceleration factor in my game. The main problem is that, as it is an Isometric game, the "speed+acceleration" and "speed+deacceleration" aren't enough to create a smooth functional moviment.
My code, for now, it's like this:

This is the code to acelerate:
(click to show/hide)

This is the code to swith the sprite's frame (The spritesheet is attached to the topic, for a better interpretation):
(click to show/hide)

And here's a simpler code that I was using to represent the moviment, but without an acceleration factor:
(click to show/hide)

My game is based on an 90's race SNES game, Rock n' Roll Racing, so, the movement I'm trying to implement looks like .

My problem resides in two problems:
1. The acceleration is different for the X axis and the Y axis at the same time, as for the velocity varies from a negative top-speed to a positive top-speed (since the moviment is in 360ยบ).
2. When my car rotates, the velocity in both axis have to change, but not in the same way (and I can't use a simple rotate method, since my car it's a spritesheet, and rotate it can bug the graphic).

My car rotate from the keys "Up" and "Down", and it's movement is triggered by the "Ctrl" key.
I've tried doing the basic "when speed is lower than tospeed, accelerate", but when the car changes the frame, it changes the top-speed, leading the car to keep the velocity equals to the top-speed of the frame that it was when the acceleration began.

I would be very grateful if you guys could help me trough this :)
Thanks, seeya o/

2
Well, hello guys! My first post, here :P

So, I'm doing a racing game for a college project and I'm planning on do a Isometric race track.

The problem is, when the track is created, I don't want to my car to walk on it's borders like Jesus or something like this, so I was thinking if it's possible to make a collision check with sf::VertexArrays?

Because I already have the tracks on the game (I did it like a tilemap), but it's impossible to make a tilemap collision, once the tiles are big, isometric and cover the ground and the border of the track. I saw the "getBounds()" method on the class, but I don't know what it returns in case of linestrip.

So, I would apreciate if you guys could help me to do a border with linestrip or give me better ways of doing this issue with another class/fuction, like ConvexShape or whatever :)

For a better explanation, I attached 2 files:
The first one it's the map as it is (Don't complain about it's quality, I know it's lame, but I'll improve it :P)
The second one it's the map, divided by it's tiles and with a YELLOW LINESTRIP, that could represent my idea of "Borders" that the car can't trespass;

Obs: Sorry about the bad english, it is not my native language
Obs: I have a car SpriteSheet example, if you guys need it :)

Pages: [1]
anything