[Weekly report] Week 2 : Nibbles port to Clutter



This week went fast but I managed to get some work done. First of all,
early in the week I fixed the worm resizing. Then I started to work on
worm's movement. I added a bunch of code related to AI from the old
worm.c to worm-clutter.c. The majority of this code can be adapted to
my Clutter implementation of worm.

So I started to work on making the worm move. In fact I had them
moving quickly in a very similar way to what Nibbles currently do.
Everything was fine until I decided do a git pull on my copy of
Clutter and update it to git master. The latest version of the Clutter
Toolkit take the frame rate concept out of ClutterTimeline[1] and
simply use a duration, in milliseconds for the timeline. For me it
cause quite a few problems. I was using the frame per seconds
parameters of the ClutterTimeline to set the speed of each worms.
Using the "new-frame" signals to call a function to move the worm at
each new frame but now that the concept of frame per second no longer
exist in ClutterTimeline, the "new-frame" signal is emitted at each
milliseconds, which complicate the management of worm's speed.

Of course, alternative exist. However they are not as simple and
convenient as the ClutterTimeline frame parameter. Using
ClutterBehavior or ClutterAnimation to continually move worms is
possible but harder to manage. I'll have to look at this possibility
or simply find a way to nicely slow down call made to my move
function. Right now I use a simple mathematical test to slow down the
movement, but the result is sketchy.

During the week, one of my fellow GSoC students, Timothy P. Horton,
set up a PPA to get your hands on the latest work done on Gnome-Games.
This include the gsoc-seed-games, sudoku-tube and gnibbles-clutter
branches of gnome-games. So if you're  a Ubuntu user and you're
interested, have a look at Timothy's blog post[2] or directly at[3].

For good measure, here's my git-shortlog. Full log available here[4]:

Guillaume Beland:
      ...
      Small fix to resize worm properly, now reloading pixmaps on resize
      Fixed worm resizing for good
      Added a bunch of code from worm.c to worm-clutter.c related to AI
      Added two files that got lost somehow along the way
      Implemented basic movement on worms & some code cleanup
      Change to follow clutter master.
      Temporary fix to slow down worm's movement ...

That's it for this week. Happy coding.

[1] http://git.clutter-project.org/cgit.cgi?url=clutter/commit/&id=9c7afe0c5bf99e38c6fd4584b8fa3b0ed02cf996
[2] http://www.hortont.com/blog/2009/06/get-your-fresh-games-here/
[3] https://launchpad.net/~gnome-games-experimental/+archive/ppa
[4] http://git.gnome.org/cgit/gnome-games/log/?h=gnibbles-clutter


Guillaume Béland


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]