Skip to content

Commit 2053064

Browse files
committed
v0.3 ready for release
1 parent 893fc1f commit 2053064

18 files changed

+1002
-5
lines changed

CHANGELOG

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1-
v0.3.0 - XXX
1+
v0.3.0 - September 5th, 2008
22
- Added particle systems: Sun, Fire, Fireworks, Meteor, Galaxy, Flower, Exposion, Spiral
3-
- Fixed Camera "once" locate bug
3+
- Added lerp actions
44
- Applied patch by naveen.michaudagrawal
5+
- Applied patch by Kao Cardoso Félix
6+
- Fixed Camera "once" locate bug
7+
- Many bugfixes
8+
- Primitive vector based line drawing.
9+
- Tile-map editor
510

611
v0.3.0rc0 - June 27th, 2008
712
- Transitions: Added ZoomTransition by Hugo Ruscitti

README

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cocos2d: A framework for building 2D games
22
http://cocos2d.org
33

4-
version: 0.3.0rc0
4+
version: 0.3.0
55

66

77
Requirements

cocos/__init__.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,20 @@
3434
http://cocos2d.org
3535
'''
3636

37-
__version__ = "0.3.0-rc0"
37+
__version__ = "0.3.0"
3838
__author__ = "cocos2d team"
3939
version = __version__
4040

41+
42+
"""
43+
add the cocos resources path
44+
"""
45+
import os, pyglet
46+
47+
pyglet.resource.path.append(os.path.join(os.path.dirname(__file__), "resources"))
48+
pyglet.resource.reindex()
49+
del os, pyglet
50+
4151
import actions
4252
import director
4353
import layer

cocos/actions/interval_actions.py

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
from base_actions import *
105105
from cocos.euclid import *
106106

107-
__all__ = [
107+
__all__ = [ 'Lerp', # interpolation
108108
'MoveTo','MoveBy', # movement actions
109109
'Jump', 'JumpTo', 'JumpBy',
110110
'Bezier', # complex movement actions
@@ -117,6 +117,38 @@
117117
'Accelerate','AccelDeccel','Speed', # Time alter actions
118118
]
119119

120+
class Lerp( IntervalAction ):
121+
"""
122+
Interpolate between values for some specified attribute
123+
124+
"""
125+
def init(self, attrib, start, end, duration):
126+
"""Init method.
127+
128+
:Parameters:
129+
`attrib` : string
130+
The name of the attrbiute where the value is stored
131+
`start` : float
132+
The start value
133+
`end` : float
134+
The end value
135+
`duration` : float
136+
Duration time in seconds
137+
"""
138+
self.attrib = attrib
139+
self.duration = duration
140+
self.start_p = start
141+
self.end_p = end
142+
self.delta = end-start
143+
144+
def update(self, t):
145+
setattr(self.target, self.attrib,
146+
self.start_p + self.delta * t
147+
)
148+
149+
def __reversed__(self):
150+
return Lerp(self.attrib, self.end_p, self.start_p, self.duration)
151+
120152
class RotateBy( IntervalAction ):
121153
"""Rotates a `CocosNode` object clockwise a number of degrees
122154
by modiying it's rotation attribute.

0 commit comments

Comments
 (0)