Ghost car

8fifty2

  • Posts: 128
I'm trying to create a ghost car for my game but need help.

So I want my racer to play while I record his movement then next run create a ghost car that will follow that path. I've looked at the follow behaviour but I can't get it to update the way I want it. I was thinking maybe if i could add a list. so every 0.5 add x and y of self to list.
Then set my ghost to follow x and y. I think it is doable but I cannot get this to work. Any help please?

t4u

  • Posts: 418
It seems reasonable(the list solution). Why it doesnt work?

On first run:
 
if first run(game attribute) ==0:
Do every 0.5 s
add x and y of car to the list 1

On the end of first run first run=1, make a copy of list1 as game attribute list2. Reload scene.

On second run:
if first run ==1:

Do every 0.5 s
add x and y of car to the list 1
set x and y of ghost car to x andy from list 2

make a copy of list1 as game attribute list2(if better time). Reload scene.

... that' pretty much how it should work. I dont know if you are creating racing game from top view or side view. If from side view you may consdier tkaing rotation into consideration
USE PICTURES WHEN YOU ASK SOMETHING!
If I helped you be sure to mention it in your game.

Tutorials + downloads:
http://t4upl.blogspot.com/

8fifty2

  • Posts: 128
This seems really good in theory but I just cant get it working. I don't think i'm using, setting or calling, the lists correctly.  I think I am setting it correctly but getting my ghost car to follow the path seems to be a pain. I'm saying move self to (get item # from my attribute).

I've tried setting up two lists one for my x and one for my y. 

Ugh I hate to sound like real noob but could you spell it out for me please.

Also its top down

« Last Edit: March 06, 2015, 07:28:18 am by 8fifty2 »

t4u

  • Posts: 418
I'm on it (meaning work in progress). We will see how long it will take.
USE PICTURES WHEN YOU ASK SOMETHING!
If I helped you be sure to mention it in your game.

Tutorials + downloads:
http://t4upl.blogspot.com/

8fifty2

  • Posts: 128
Thank you. Hopefully it will be a piece of cake for you. I will actually have to finish this project.

t4u

  • Posts: 418
You move by arrows. The aim is to collect yellow points. After collecting 3 yellow points timer stops. You press R to start again. On second run you will see red square which represent a ghost car.  I have no idea why sometimes new best time and timer stopped can be different.

Let me know if something doesn't work.

« Last Edit: March 06, 2015, 02:54:47 pm by t4u »
USE PICTURES WHEN YOU ASK SOMETHING!
If I helped you be sure to mention it in your game.

Tutorials + downloads:
http://t4upl.blogspot.com/

8fifty2

  • Posts: 128
Thank you. What you have done seems great. I'm just trying to reverse engineer it but it is way more complicated then expected. I think I am going to have to sleep on it and come back tomorrow.

Thanks again, you have gone way over what help I expected. I will keep you posted

t4u

  • Posts: 418
Let me know which part remains mystery. I think code is short enough for you to figure out but in case of quesitons ask.

Try this as you will be reverse engineering:
http://t4upl.blogspot.com/2015/03/stencylghost-car-difficulty410-whatis.html

« Last Edit: March 06, 2015, 07:11:15 pm by t4u »
USE PICTURES WHEN YOU ASK SOMETHING!
If I helped you be sure to mention it in your game.

Tutorials + downloads:
http://t4upl.blogspot.com/

8fifty2

  • Posts: 128
You have really gone into a lot of effort with this. When I get it finished I'll be sure to add you a special thanks credit.

Thank you for your help. I will keep you posted with it








OSZAR »
OSZAR »