[Gambas-devel] Invader example does not work

Tobias Boege tobias at ...692...
Sun May 12 16:55:34 CEST 2013


On Sun, 12 May 2013, Beno?t Minisini wrote:
> Le 12/05/2013 16:04, Tobias Boege a ?crit :
> > On Sun, 12 May 2013, Beno?t Minisini wrote:
> >> Hi Tobias,
> >>
> >> I tried the Invader example, but it does not seem to work. I see
> >> mainly rubbish in the terminal.
> >>
> >> --
> >> Beno?t Minisini
> >
> > Yeah, I should explain:
> >
> > There are currently no levels or anything. You are prompted with approx. 1/3
> > of the screen full of enemies - and must survive! This is what you see at
> > the top. You have a rather huge screen, sorry for that :-)
> >
> > I used an 80*24 terminal to test. This shows that there is, as for Pong,
> > some formula needed that involves both: height and width of a terminal to
> > caluclate enemy positions and amount...
> >
> > As for the asterisks: red and magenta enemies are Borg. They are able to
> > shoot on you with green asterisks. The chance they do is 1/2000th with every
> > move[0].
> >
> >>From the picture, I can tell that the game functions quite like I wrote it.
> > It's only that I wrote it badly :-) To test it, you should for now set the
> > environment variables LINES and COLUMNS to 24 resp. 80 before starting the
> > program. This makes ncurses pretend it runs in such a terminal.
> >
> > I don't know how your starship could lose the left wing, though...
> >
> > Regards,
> > Tobi
> >
> > [0] I let my brother play it yesterday and he discovered that not only Borg
> >      are able to shoot. That's true and it's a trivial bug I will correct
> >      soon. Note that the chance to shoot for a Borg is 1/2000th of *every*
> >      move an enemies does - even if non-Borg (that's where the bug is
> >      currently). So the more enemies, the more shoots you'll see. Again, this
> >      depends on your terminal size.
> >
> >
> 
> Can gb.ncurses request a terminal size? I'm not sure, but I think it is 
> possible.

Yep. You can do it right from Gambas with Screen.Resize(). Alas, the
signature of this method is wrong in the GB_DESC of Screen. It doesn't
accept arguments. I'll commit a fix in a few minutes.

Regards,
Tobi





More information about the Devel mailing list