PDA

View Full Version : Revival: Angle Racer



edg3
03-03-2008, 03:07 PM
http://img339.imageshack.us/img339/4610/mirrorsno3.th.jpg (http://img339.imageshack.us/my.php?image=mirrorsno3.jpg) - early image, when I had 2 types of mirror....
http://img46.imageshack.us/img46/3213/attid010d0a25mj0.th.png (http://img46.imageshack.us/my.php?image=attid010d0a25mj0.png)
http://img233.imageshack.us/img233/7915/98827808tt6.th.jpg (http://img233.imageshack.us/my.php?image=98827808tt6.jpg)

I finally think I have time to quickly revive this so it can finally be completed before I get onto working on my newer projects, but I have a few issues at this point still.

Code links:
older code (http://realdev.co.za/node/47)
New code - almost complete (http://realdev.co.za/node/48)

My issue right now is that when I rotate any mirror it changes how the line reflects, even if the mirror isnt actually in the lines path at any point. Its a very niggly error that I cant seem to get around, so Im hoping that somone can spot my error and help me, so that I cant give everyone the complete project. (promised myself I would finish it, and have other people that also want to see me finish this)

All my levels and my scoring system is ready, all I need is help finding the error in the new code :)

All help is appreciated.

Thaumaturge
04-03-2008, 12:32 AM
Hmm... I may well be missing something (and I'll add that I'm not familiar with GameMaker), but why do you seem to advance again before testing for the appropriate collision?

If I may post a snippet of your code here:


//draw
draw_line(my_x,my_y,x_to,y_to);
my_x = x_to;
my_y = y_to;
//begin check of what the mirror was
x_to = my_x + round(lengthdir_x(length + 1, my_dir));
y_to = my_y + round(lengthdir_y(length + 1, my_dir));

You advance my_x and my_y to the target point, then advance the target point in the same direction by the same amount as produced the original collision.

Hmm... Looking at it again, did you perhaps mean "x_to = my_x + round(lengthdir_x(1, my_dir));", and similarly for y?

That looks as though it should take you to the collision point, which is, I think, what you want to test.

edg3
04-03-2008, 02:44 PM
Hmm... Looking at it again, did you perhaps mean "x_to = my_x + round(lengthdir_x(1, my_dir));", and similarly for y?
Hmm, will test this, maybe its my whole problem :) will let you know.

Thats sorted out the reflections, thanks :) now just to get it to ignore wall blocks and have a maximum length, and to finalise to scoring.

Thaumaturge
04-03-2008, 04:58 PM
My pleasure - I'm glad to have helped. ^_^