angry-pixel 2.0.5 → 2.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +7 -0
- package/lib/index.cjs.js +1 -1
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.d.ts +53 -12
- package/lib/index.esm.js +1 -1
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -533,6 +533,7 @@ type SearchCriteria = {
|
|
|
533
533
|
declare class EntityManager {
|
|
534
534
|
private lastEntityId;
|
|
535
535
|
private lastComponentTypeId;
|
|
536
|
+
private entities;
|
|
536
537
|
private components;
|
|
537
538
|
private disabledEntities;
|
|
538
539
|
private disabledComponents;
|
|
@@ -601,7 +602,17 @@ declare class EntityManager {
|
|
|
601
602
|
*/
|
|
602
603
|
removeAllEntities(): void;
|
|
603
604
|
/**
|
|
604
|
-
*
|
|
605
|
+
* If the Entity exists, returns TRUE, otherwise it returns FALSE
|
|
606
|
+
* @param entity
|
|
607
|
+
* @returns boolean
|
|
608
|
+
* @example
|
|
609
|
+
* ```js
|
|
610
|
+
* const isEntity = entityManager.isEntity(entity);
|
|
611
|
+
* ```
|
|
612
|
+
*/
|
|
613
|
+
isEntity(entity: Entity): boolean;
|
|
614
|
+
/**
|
|
615
|
+
* If the Entity is enabled, returns TRUE, otherwise it returns FALSE
|
|
605
616
|
* @param entity The entity to verify
|
|
606
617
|
* @returns boolean
|
|
607
618
|
* @public
|
|
@@ -1588,6 +1599,14 @@ interface TiledObject {
|
|
|
1588
1599
|
x: number;
|
|
1589
1600
|
y: number;
|
|
1590
1601
|
properties?: TiledProperty[];
|
|
1602
|
+
polygon?: {
|
|
1603
|
+
x: number;
|
|
1604
|
+
y: number;
|
|
1605
|
+
}[];
|
|
1606
|
+
polyline?: {
|
|
1607
|
+
x: number;
|
|
1608
|
+
y: number;
|
|
1609
|
+
}[];
|
|
1591
1610
|
}
|
|
1592
1611
|
/**
|
|
1593
1612
|
* @public
|
|
@@ -1898,14 +1917,16 @@ declare class PolygonCollider implements Collider {
|
|
|
1898
1917
|
|
|
1899
1918
|
/**
|
|
1900
1919
|
* The type of the rigid body to create:
|
|
1901
|
-
* - Dynamic
|
|
1902
|
-
* -
|
|
1920
|
+
* - **Dynamic:** This type of body is affected by gravity and velocity and can be moved by other rigid bodies.
|
|
1921
|
+
* - **Kinematic:** This type of body is not affected by gravity and cannot be moved by other rigid bodies, but can be velocity applied.
|
|
1922
|
+
* - **Static:** This type of body is immobile, is not affected by velocity or gravity and cannot be moved by other rigid bodies.
|
|
1903
1923
|
* @category Components
|
|
1904
1924
|
* @public
|
|
1905
1925
|
*/
|
|
1906
1926
|
declare enum RigidBodyType {
|
|
1907
1927
|
Dynamic = 0,
|
|
1908
|
-
|
|
1928
|
+
Kinematic = 1,
|
|
1929
|
+
Static = 2
|
|
1909
1930
|
}
|
|
1910
1931
|
/**
|
|
1911
1932
|
* RigidBody configuration options
|
|
@@ -1921,6 +1942,14 @@ declare enum RigidBodyType {
|
|
|
1921
1942
|
});
|
|
1922
1943
|
* ```
|
|
1923
1944
|
* @example
|
|
1945
|
+
* ```js
|
|
1946
|
+
const rigidBody = new RigidBody({
|
|
1947
|
+
rigidBodyType: RigidBodyType.Kinematic,
|
|
1948
|
+
velocity: new Vector2(1, 0),
|
|
1949
|
+
acceleration: new Vector2(1, 0)
|
|
1950
|
+
});
|
|
1951
|
+
* ```
|
|
1952
|
+
* @example
|
|
1924
1953
|
* ```js
|
|
1925
1954
|
const rigidBody = new RigidBody({
|
|
1926
1955
|
rigidBodyType: RigidBodyType.Static,
|
|
@@ -1930,32 +1959,36 @@ declare enum RigidBodyType {
|
|
|
1930
1959
|
interface RigidBodyOptions {
|
|
1931
1960
|
/**
|
|
1932
1961
|
* The type of the rigid body to create:
|
|
1933
|
-
* - Dynamic
|
|
1934
|
-
* -
|
|
1962
|
+
* - **Dynamic:** This type of body is affected by gravity and velocity and can be moved by other rigid bodies.
|
|
1963
|
+
* - **Kinematic:** This type of body is not affected by gravity and cannot be moved by other rigid bodies, but can be velocity applied.
|
|
1964
|
+
* - **Static:** This type of body is immobile, is not affected by velocity or gravity and cannot be moved by other rigid bodies.
|
|
1935
1965
|
* @public
|
|
1936
1966
|
*/
|
|
1937
1967
|
type: RigidBodyType;
|
|
1938
1968
|
/**
|
|
1939
|
-
* Velocity applied to the x-axis and y-axis expressed in pixels per second.
|
|
1969
|
+
* Velocity applied to the x-axis and y-axis expressed in pixels per second. For Dynamic and Kinematic bodies.
|
|
1940
1970
|
* @public
|
|
1941
1971
|
*/
|
|
1942
1972
|
velocity: Vector2;
|
|
1943
1973
|
/**
|
|
1944
|
-
* Gravity expressed in pixels per second squared. Only for Dynamic bodies
|
|
1974
|
+
* Gravity expressed in pixels per second squared. Only for Dynamic bodies.
|
|
1945
1975
|
* @public
|
|
1946
1976
|
*/
|
|
1947
1977
|
gravity: number;
|
|
1948
1978
|
/**
|
|
1949
|
-
* Acceleration expressed in pixels per second squared.
|
|
1979
|
+
* Acceleration expressed in pixels per second squared. For Dynamic and Kinematic bodies.
|
|
1950
1980
|
* @public
|
|
1951
1981
|
*/
|
|
1952
1982
|
acceleration: Vector2;
|
|
1953
1983
|
}
|
|
1954
1984
|
/**
|
|
1955
1985
|
* The RigidBody component puts the entity under simulation of the physics engine, where it will interact with other objects that have a RigidBody.\
|
|
1956
|
-
* There are
|
|
1957
|
-
* - Dynamic
|
|
1958
|
-
* -
|
|
1986
|
+
* There are three types of bodies:
|
|
1987
|
+
* - **Dynamic:** This type of body is affected by gravity and velocity and can be moved by other rigid bodies.
|
|
1988
|
+
* - **Kinematic:** This type of body is not affected by gravity and cannot be moved by other rigid bodies, but can be velocity applied.\
|
|
1989
|
+
* This type of body consumes less processing resources than the Dynamic.
|
|
1990
|
+
* - **Static:** This type of body is immobile, is not affected by velocity or gravity and cannot be moved by other rigid bodies.\
|
|
1991
|
+
* This is the body type that consumes the least processing resources.
|
|
1959
1992
|
* @public
|
|
1960
1993
|
* @category Components
|
|
1961
1994
|
* @example
|
|
@@ -1968,6 +2001,14 @@ interface RigidBodyOptions {
|
|
|
1968
2001
|
});
|
|
1969
2002
|
* ```
|
|
1970
2003
|
* @example
|
|
2004
|
+
* ```js
|
|
2005
|
+
const rigidBody = new RigidBody({
|
|
2006
|
+
rigidBodyType: RigidBodyType.Kinematic,
|
|
2007
|
+
velocity: new Vector2(1, 0),
|
|
2008
|
+
acceleration: new Vector2(1, 0)
|
|
2009
|
+
});
|
|
2010
|
+
* ```
|
|
2011
|
+
* @example
|
|
1971
2012
|
* ```js
|
|
1972
2013
|
const rigidBody = new RigidBody({
|
|
1973
2014
|
rigidBodyType: RigidBodyType.Static,
|