Re: GSoC: Convert a game to Clutter
- From: Guillaume Beland <guillaume beland gmail com>
- To: "Jason D. Clinton" <me jasonclinton com>
- Cc: games-list gnome org
- Subject: Re: GSoC: Convert a game to Clutter
- Date: Tue, 10 Mar 2009 18:47:06 -0400
> Sorry for the delay in getting back to you; I was on a business trip
> this past week
Hi Jason, no problem.
> Nibbles would be fine. I am curious how you think you might implement
> the actors though? One large actor for the snake will probably not
> perform very well, so I think you will need 1 actor per straight
> segment and 1 actor per corner. The 'fill' of the segment can probably
> be accomplished with a special texture repeat.
That's what I thought too, because each worm follow a certain path and
drawing a single actor per worm wouldn't be efficient and quite hard
to do when a worm change direction for instance.
Worm are currently represented as a series of "dot" (SVG images), It
would be easy to reproduce this . Adding and removing an actor at the
head/tail of the worm as it move but I don't really like the idea of
creating that much actor.
So my approach would be like you said, A worm would consist of a list
of actors, let's say "corner" actors and "fill" actors. Reducing the
size of the last actor in the list and increasing the size of the
first actor in the list as the worm move forward. When the last actor
in the list reach a "corner" actor (its size reach 0), we destroy it.
When the worm change direction, we add a "corner" actor and a new
"fill" actor to the list, pointing to the new direction. etc.
Also, implemented this way, effects could be applied to particular
actor in the worm, For example, when a worm eat a cherry and reduce
it's size, do a "flash" effect (quick fade out/fade in) on the portion
of the worm that will be destroyed. things like that.
I would love to come up with a solution where the worm would move on
the board rather than just increase and decrease its size but for the
moment that's all I can think of.
What do you think ?
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]