Well, it sounds great that it's a lot faster than the firmware call. Would love to see it in action.
But I don't want to develop for FutureOS, sorry. I don't want to require people to have FutureOS in order to run my stuff.
Looks great!!! Do you have a source code for it? If you have one (in Small C for example), then I can try to convert it to CPC.
Well it's plain HTML/Javascript, so you can view the source in the browser. But here it is:
<script type="text/javascript">
// Adjust the canvas to fit the screen.
document.getElementById("GameCanvas").width=window.innerWidth;
document.getElementById("GameCanvas").height=window.innerHeight;
var g = getGraphics(); // The object with all the drawing methods. The class I'd love to have for CPC :->
var w = getWidth();
var h = getHeight();
var t = 0;
var c = 3.141592654;
var count = 0;
var cyclems = 0;
var lastTime = System.currentTimeMillis();
var lastX = w/2;
var lastY = h/2;
function mainloop() {
cyclems = System.currentTimeMillis()-lastTime;
lastTime = System.currentTimeMillis();
while (cyclems>5) {
cyclems-=5;
c += 0.00001;
}
t = c;
count = 0;
g.setClip(0,0,w,h);
g.setColor(0x000000);
g.fillRect(0, 0, w, h);
lastX = w/2;
lastY = h/2;
while (count < 200) {
g.setColor(t * 64+0xff0000);
newX = (Math.cos(t) * t + w / 2);
newY = (Math.sin(t) * t + h / 2);
g.drawLine(lastX, lastY, newX, newY);
lastX = newX;
lastY = newY;
t += c;
count++;
}
setTimeout("mainloop()", 10); // Wait 10 milliseconds, then draw again
}
mainloop(); // Start it up
</script>
Note, that the above code is using those drawing methods from J2ME, because I've made Javascript "classes" that translates them into HTML5-Canvas code. That makes it easier for me to code for J2ME + HTML5. (I've done the same with Flash/Flex3 and Android and would love to be able to do it for the CPC as well. Use the same methods to code for J2ME, Flash, HTML5, Android, Amstrad....)
Original J2ME version of the code:
private Stoney midlet;
private int w, h, count, lastX, lastY, newX, newY;
private Graphics g;
private double t, c;
private long lastTime;
private int cyclems;
this.setFullScreenMode(true);
g = getGraphics();
w = getWidth();
h = getHeight();
t = 0;
c = 3.141592654;
count = 0;
cyclems = 0;
lastTime = System.currentTimeMillis();
while (true) {
cyclems = (int)(System.currentTimeMillis()-lastTime);
lastTime = System.currentTimeMillis();
while (cyclems>10) {
cyclems-=10;
c += 0.0001;
}
t = c;
count = 0;
g.setColor(0x000000);
g.fillRect(0, 0, w, h);
lastX = w/2;
lastY = h/2;
while (count < 200) {
g.setColor((int) (t * 64));
newX = (int) (Math.cos(t) * t / 7 + w / 2);
newY = (int) (Math.sin(t) * t / 7 + h / 2);
g.drawLine(lastX, lastY, newX, newY);
lastX = newX;
lastY = newY;
t += c;
count++;
}
flushGraphics();
try {
Thread.sleep(10);
} catch (Exception e) {
}
}