[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Enigma-cvs] enigma/src stones_simple.cc,1.60,1.61
From: |
Daniel Heck <address@hidden> |
Subject: |
[Enigma-cvs] enigma/src stones_simple.cc,1.60,1.61 |
Date: |
Sat, 01 Nov 2003 23:43:44 +0000 |
Update of /cvsroot/enigma/enigma/src
In directory subversions:/tmp/cvs-serv28115/src
Modified Files:
stones_simple.cc
Log Message:
* Make st-window easier to destroy
* Animated models for st-switch[_black|_white]
Index: stones_simple.cc
===================================================================
RCS file: /cvsroot/enigma/enigma/src/stones_simple.cc,v
retrieving revision 1.60
retrieving revision 1.61
diff -C2 -d -r1.60 -r1.61
*** stones_simple.cc 27 Oct 2003 22:17:38 -0000 1.60
--- stones_simple.cc 1 Nov 2003 23:43:42 -0000 1.61
***************
*** 526,530 ****
{
double impulse = -(a->get_vel() * sc.normal) * a->get_mass();
! if (impulse > 30) {
SendMessage(a, "shatter");
}
--- 526,530 ----
{
double impulse = -(a->get_vel() * sc.normal) * a->get_mass();
! if (impulse > 35) {
SendMessage(a, "shatter");
}
***************
*** 1299,1312 ****
Switch_black() : OnOffStone("st-switch_black") {}
private:
void init_model() {
! set_model(is_on() ? "st-switch_black1" : "st-switch_black2");
}
void actor_hit(const StoneContact &sc)
{
! if (sc.actor->get_attrib("blackball"))
! set_on(!is_on());
PerformAction(this, is_on());
- play_sound("st-switch");
}
--- 1299,1321 ----
Switch_black() : OnOffStone("st-switch_black") {}
private:
+ enum State { IDLE, TOGGLING } state;
void init_model() {
! set_model(is_on() ? "st-switch_black-on" : "st-switch_black-off");
}
void actor_hit(const StoneContact &sc)
{
! if (state == IDLE && sc.actor->get_attrib("blackball")) {
! state = TOGGLING;
! if (is_on())
! set_anim("st-switch_black-turnoff");
! else
! set_anim("st-switch_black-turnon");
! }
! }
! void animcb() {
! state = IDLE;
! set_on(!is_on());
PerformAction(this, is_on());
}
***************
*** 1333,1346 ****
Switch_white() : OnOffStone("st-switch_white") {}
private:
void init_model() {
! set_model(is_on() ? "st-switch_white1" : "st-switch_white2");
}
void actor_hit(const StoneContact &sc)
{
! if (sc.actor->get_attrib("whiteball"))
! set_on(!is_on());
PerformAction(this, is_on());
- play_sound("st-switch");
}
--- 1342,1364 ----
Switch_white() : OnOffStone("st-switch_white") {}
private:
+ enum State { IDLE, TOGGLING } state;
void init_model() {
! set_model(is_on() ? "st-switch_white-on" : "st-switch_white-off");
}
void actor_hit(const StoneContact &sc)
{
! if (state == IDLE && sc.actor->get_attrib("whiteball")) {
! state = TOGGLING;
! if (is_on())
! set_anim("st-switch_white-turnoff");
! else
! set_anim("st-switch_white-turnon");
! }
! }
! void animcb() {
! state = IDLE;
! set_on(!is_on());
PerformAction(this, is_on());
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Enigma-cvs] enigma/src stones_simple.cc,1.60,1.61,
Daniel Heck <address@hidden> <=
- Prev by Date:
[Enigma-cvs] enigma/data/gfx st-switch_white.png, NONE, 1.1 st-switch_black.png, NONE, 1.1
- Next by Date:
[Enigma-cvs] enigma CHANGES,1.9,1.10
- Previous by thread:
[Enigma-cvs] enigma/data/gfx st-switch_white.png, NONE, 1.1 st-switch_black.png, NONE, 1.1
- Next by thread:
[Enigma-cvs] enigma CHANGES,1.9,1.10
- Index(es):