Page 1 of 1

Rotate Sprites / Joystick

PostPosted: Tue Mar 09, 2010 9:48 am
by akr
Hi,

2 questions today.

(a) Rotation
Is there a way to rotate sprites? I thought Kyra can do this with tiles.

Is GE using kyra sprites or tiles. If tiles, is it a big effort to implement rotation?

(b) Joystick
It maybe interesting on iphone to have a joystick. SDL13 translates the accelerometer to joystick movements.
Whats the effort to do this?

Thx
Andreas

Re: Rotate Sprites / Joystick

PostPosted: Tue Mar 09, 2010 1:52 pm
by Hblade
Well, there is one way. It's called bmprotation or something like that. It loads a BMP into a canvas which can then be altered.

Re: Rotate Sprites / Joystick

PostPosted: Tue Mar 09, 2010 5:18 pm
by makslane
akr wrote:Is there a way to rotate sprites? I thought Kyra can do this with tiles.
Is GE using kyra sprites or tiles. If tiles, is it a big effort to implement rotation?


The rotation can be implemented if use the OpenGL ES support (there are some test points in the code to enable the OpenGL ES tests).

(b) Joystick
It maybe interesting on iphone to have a joystick. SDL13 translates the accelerometer to joystick movements.
Whats the effort to do this?


There are no joystick support on the current engine.
For iPhone accelerometer , I think is better we have some function thats can be called by the user on script like this:

Code: Select all
Vector g = getAccelInfo(); //g is a struct of x, y, z doubles

Re: Rotate Sprites / Joystick

PostPosted: Wed Mar 10, 2010 10:08 am
by akr
Maks,

Thanks for your reply! Btw iphone prototype is now working. 1945 runs at full realtime speed! Really fun.

I am asking about rotating sprites because I am interested to implement more physics in future (chipmumks or box2d). So a rotation
around a defined point is required. Will have a look at the code. Maybe I can find the points you mentioned.

Regarding joystick. Do you think joystick support is not something which is really required or is it a lot of effort?

Good idea to have the code as you suggested in script editor:

Vector g = getAccelInfo(); //g is a struct of x, y, z doubles

But doesnt that mean games would become incompatible? Or should we just have this function available on all plattforms?

We could

-Have that function available on all plattforms for compatibility reasons
-Return 0,0,0 if its not iphone

Then it shouldnt be any more an issue.


Sound
====

My testcase 1945 seems to use filename.mid which seems to be a midi file. Am I wrong? Pls advise. You said midi isnt available in general.

Thx
Andreas

Re: Rotate Sprites / Joystick

PostPosted: Wed Mar 10, 2010 1:46 pm
by makslane
akr wrote:Btw iphone prototype is now working. 1945 runs at full realtime speed! Really fun.


Are you sure?????? I'm really happy now :-)

I am asking about rotating sprites because I am interested to implement more physics in future (chipmumks or box2d). So a rotation
around a defined point is required. Will have a look at the code. Maybe I can find the points you mentioned.


But is better finish the iPhone port of the current code first.
After that, the changes like this will works on all platforms thats have a hardware acceleration card.

Regarding joystick. Do you think joystick support is not something which is really required or is it a lot of effort?


I don't think is required for mobile devices!

Good idea to have the code as you suggested in script editor:

Vector g = getAccelInfo(); //g is a struct of x, y, z doubles

But doesnt that mean games would become incompatible? Or should we just have this function available on all plattforms?

We could

-Have that function available on all plattforms for compatibility reasons
-Return 0,0,0 if its not iphone


Any mobile phone that's hace an accelerometer will can use this function.
If the device doesn't have an accelerometer or (the case now) the accelerometer code is not ported for the other devices, we can just return (0,0,0)

My testcase 1945 seems to use filename.mid which seems to be a midi file. Am I wrong? Pls advise. You said midi isnt available in general.


The 1945 game uses a midi file. The mid playback isn't available on the Pocket PC port too. So, if you can hear the other sound effects, your port is ok :-)

BTW, Can you send me your changes? So I can start integrating on the main code base :-)

Re: Rotate Sprites / Joystick

PostPosted: Thu Mar 11, 2010 5:52 am
by skydereign
Got it working already? This will be a huge step for gameEditor if you can get it fully functioning. When do you think you'll finish it?

Re: Rotate Sprites / Joystick

PostPosted: Thu Mar 11, 2010 7:32 am
by akr
I just moved to makslanes iphone thread. See there for more details.

Re: Rotate Sprites / Joystick

PostPosted: Thu Mar 11, 2010 6:51 pm
by Hblade
For the joystick, use Xpadder :3