[Kde-games-devel] KBounce - Bug or feature?

Andreas Scherf ascherfy at googlemail.com
Thu Mar 25 19:27:46 CET 2010


Hi, yes that is a bug.
I think it is something like:
https://bugs.kde.org/show_bug.cgi?id=162527
If you want, i could patch kbounce for you. I currently working on some
improvents in kbounce.

Andreas

2010/3/25 Danyluk Tamás <tamas.danyluk2 at gmail.com>

> Dear Developers,
> I am very new to mailing lists and open source programming, but I
> ported KBounce (newest SVN) to J2ME recently as a school project.
> I think I found a bug in it.
> If you click the very left empty tile with horizontal cursor, or the
> very top empty tile with vertical cursor, no wall will be built.
> This behavior is caused by the following code:
> board.cpp 296:
>
>     // This small constant is added to each of the coordinates to
>     // avoid positive collision test result when tested rect lies
>     // on the edge of non-free space
>     qreal D = 0.01;
>     ....
>     p = rect.topRight();
>     int ur = m_tiles[static_cast<int>( p.x() - D )][static_cast<int>(
> p.y() + D )];
>     if ( ur != Free) normal += KBounceVector( -1, 1 );
>
> It makes the "right wall" collide with tile(0,y), because
> m_tiles[1-0.01] is m_tiles[0].
> The same way the "down wall" collides with tile(x,0).
>
> To correct this (i think) unresponsive behaviour, you should insert this
> code to
> wall.cpp 218
>
> if (m_dir == Right)
> {
>         m_boundingRect.setRight(x + 1);
> }
> else if (m_dir == Down)
> {
>         m_boundingRect.setBottom(y + 1);
> }
>
> It works fine in my java implementation, but i didnt try to build the
> original.
> Please give it a try if you think it makes the program better.
> By the way my J2ME portcan be found here:
> http://kennysp2.info/programs/jbounce/microemu-demo.html
> Thanks...
>
> Danyluk Tamás
> _______________________________________________
> kde-games-devel mailing list
> kde-games-devel at kde.org
> https://mail.kde.org/mailman/listinfo/kde-games-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/kde-games-devel/attachments/20100325/f9954a52/attachment.htm 


More information about the kde-games-devel mailing list