What it does is render a screen of boxes moving at different rates. One at 100 pixels per second, another 200, etc. I've got that figured out.
However, I've encountered a problem. The boxes move at expected speeds if it's running at the target speed, of 30 frames per second. But it breaks, if it runs slower, such as at 6, when rendering it for higher resolutions. The boxes move slower than they should.
(this is supposed to be a simple LCD response time test, for the record)
The relevant code block is as follows.
//define dimensions global.testAreaWidth = 720; global.testAreaHeight = 480; //define block size blockWidth = global.testAreaWidth/5; blockHeight = global.testAreaHeight/5; //define block movement speed(px/s) blockSpeed = 100; blockSpeed = 200; blockSpeed = 400; blockSpeed = 800; //spawn blocks instance_create(global.testAreaWidth/16,global.testAreaHeight/16,block0); instance_create(global.testAreaWidth/16,(global.testAreaHeight/16)+(blockHeight+(blockHeight/16)),block1); instance_create(global.testAreaWidth/16,(global.testAreaHeight/16)+((blockHeight+(blockHeight/16))*2),block2); instance_create(global.testAreaWidth/16,(global.testAreaHeight/16)+((blockHeight+(blockHeight/16))*3),block3); //initiate their motion block0.hspeed=blockSpeed/room_speed; block1.hspeed=blockSpeed/room_speed; block2.hspeed=blockSpeed/room_speed; block3.hspeed=blockSpeed/room_speed;Now, The problem is after the "initiate their motion" comment.
block0.hspeed=blockSpeed/room_speed;(there are 4, let's just use the first)
I figured, that if i divided the number of pixels to move per second, by the room speed, and set that to the horizontal velocity of the block, that it would work. The blocks would move at the desired speed when the recorded frames are played back at the speed of room_speed. (important, this is my goal) However.. tests have shown otherwise.
You may acquire my GMK hereto test.
Now.. I'm not quite sure what the cause of this is. Is there a flaw in my logic I have not realized? Have I misunderstood how hspeed functions? Can anybody notice what I've done wrong?
Thank you. Apologies in the scenario that the solution/problem is blindingly obvious, and that I missed it. It happens sometimes.
Edited by Recreate, 22 February 2012 - 01:20 AM.