http://scratch.mit.edu/projects/blaster395/2509873
The craft is supposed to collide with the white area in a way such that although parts of the craft can enter the white area, the whole craft cannot leave the track.
Here is the diagnosis:
Collision works perfectly in download version, keeping the craft on the track
Collision also works perfectly in the flash player
However, collision works so poorly in the java version that it can't keep the craft on the track at all. I am CERTAIN that the scripts are at least partly detecting the colour collision, because the vehicle is slowed even when accelerating by being in the white area.
What exactly is causing this issue?
Last edited by blaster395 (2012-05-02 14:13:27)
Offline
I think that is probably just an issue with the java player - you could try changing the script a little, but there isn`t much you can do about it.
Maybe you should report it in Bugs and Issues?
Offline
I think it has something to do with the fact that rotated sprites are blended to make the sprite look smooth. This doesn't happen in Flash in the same way; the output is not just a 480x360 image (you can see if you right-click and zoom in). It may be that the Java player doesn't recognize your sensing colors because they are changed when the craft turns. Try increasing the size of the sensing parts of the sprite to be 3x3 pixels.
Offline
amcerbu wrote:
Try increasing the size of the sensing parts of the sprite to be 3x3 pixels.
Doing this has a major negative affect on the appearance of the game.
The vastly improved first playable version (Scrolling background for the win) also suffers from the exact same problem, despite minor changes to the positioning of the collision detectors.
http://scratch.mit.edu/projects/blaster395/2510419
Last edited by blaster395 (2012-05-02 20:17:33)
Offline
Ah, sorry about that. There's one other option, though. Use two sprites for the two sensors. This will ensure that the sensors are in the right places before checking for collisions. You can use ghost effect = 100 to make them completely invisible, and consequently whatever size you want. You then use the "touching color white" block inside each sensor script to detect collisions.
Main Racer Sprite - Insert this into your main script:
when gf clicked forever motion scripts WASD keys scripts etc. broadcast [sensorUpdate v] and wait // Make sure you wait. continue with normal scripts endSensor 1:
when gf clicked set [ghost v] effect to [100] when I receive [sensorUpdate v] go to (appropriate location) deal with sensing for Sensor 1Sensor 2
when gf clicked set [ghost v] effect to [100] when I receive [sensorUpdate v] go to (appropriate location) deal with sensing for Sensor 2
Last edited by amcerbu (2012-05-03 10:07:35)
Offline
That may work, but considering there are 6 sensors per craft, it might cause lag problems. Regardless, I will take a look at it as a possibility.
Offline