I suggest that the scene will have 3 types:
-- Clipping, as we do today;
-- Infinite, as Logo has;
-- Wrapable, that is, exit from left come from right, top to bottom, etc.
I am trying to code the Atari game 'Combat'. There is no problem with the tanks, but where I wanted to code the air planes, it is very tricky. So I gave up. If I could define the scene as 'wrappable', that would be trivial.
I suggest that for the background we will be able to 'set scene as ...', and select one of the 3 above.
thanks,
Doron
Offline
I does not even have to be programmable. When the 'stage' is selected, allow selecting one of the 3 options above, in the same way that when a 'sprite' is selected you can change the rotation mode (rotate; only right-left; no-rotate).
thanks,
Doron Rajwan
Offline
Wrappable is possible with scripting.
[blocks]<when green flag clicked>
INSERT MOVEMENT SCRIPTS HERE
<if><( <x position> <<> -239 )>
<set x to( 239
<end>
<if><( <x position> <>> 239 )>
<set x to( -239
<end>
<if><( <y position> <<> -179 )>
<set y to( 179
<end>
<if><( <y position> <>> 179 )>
<set y to( -179
<end>[/blocks]
But I don't think Infinite is possible, unless you use scrolling.
Last edited by technoguyx (2009-04-12 12:57:12)
Offline
In theory, you can.
In practice, there are two player + two bulettes, that is, the code you wrote will be cloned 4 times. In addition, the drawing on the screen, and the collision detection will be incorrect.
At the end, this suggestion is an approximation, and harder than implementing it correctly.
I understand Scratch simplicity tradeoffs, but this will not add too much complexity, and it will allow the 'scene' to have 3 buttons, same as 'sprite'.
Doron
Offline
I hate when scratch gets tricky.
Offline
keroro645 wrote:
Ok, could you help me on this?
What is clipping and infinite?
Clipping is what we have today. If your sprite x/y is going to be out of the screen, they are clipped to the screen, if you want it or not. Clipping = set to the border of the screen.
So, if you want to paint an octagon by 8x(forward 50, turn +45), it will 'close' only if you are at the middle of the screen. Otherwise, it will break.
Infinite is a mode where the screen is infinite. Things that fall off the edge are simply not displayed. The user views some region within this infinite screen, where everything else still happening. In the examle below, you will always get a 'closed' cotagon, but maybe some of it will be 'off-screen'.
If two sprites are off-screen, allowing them to colliede or not is an open question. I think that collision detection must still work for this mode to be useful.
Doron
Offline