-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSword.java
More file actions
109 lines (92 loc) · 2.66 KB
/
Copy pathSword.java
File metadata and controls
109 lines (92 loc) · 2.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
package com.smiths;
import org.andengine.entity.primitive.Rectangle;
import org.andengine.entity.shape.Shape;
import org.andengine.opengl.texture.region.TiledTextureRegion;
import org.andengine.opengl.vbo.VertexBufferObjectManager;
import com.smiths.GameCharacter;
public class Sword extends GameObject {
//wondering how much of this is duplicated and is already inheriting from GameObject
public Rectangle bodyRect;
public Shape collider;
public float currentscale = 1;
public float scalingfactor = (float) 0.3;
public boolean collision = false;
public int antigravity = 0;
public int ypos;
public int xpos;
public int weapon = 1;
public int oldxpos;
public int oldypos;
public int xdirection = 0;
public int ydirection = 0;
public int velocity_y = 0;
public int velocity_x = 0;
public int difference = 0;
public boolean topofjump = false;
public int oldanim = 0;
public boolean isActive = true;
public int speed;
public boolean justAppeared = true;
public double acceleration=0;
public int lastxdirection = 0;
public double xmovement =0;
public int deathtimer =0;
public boolean attack = true;
public boolean isHit = false;
public boolean isAlive = true;
public int hitDirection = 0;
public int hitTimer = 0;
public boolean isHittable = true;
public int level = 1;
public int hitPower = 50;
public int totalHealth=1;
public int currenthealth=totalHealth;
public int deathanim = 0;
public boolean healthPowerUp = false;
public int specificAttack =100;
public boolean isPlayer = false;
public int kills = 0;
public int experience = 0;
public int rotationcounter=0;
public boolean locationlocked = false;
public int ymomentum=0;
public int xmomentum=0;
public boolean attacksuccessful=true;
public GameCharacter thrower;
public Rectangle leftSide;
public Rectangle rightSide;
public boolean isDropped =false;
public boolean startattack = true;
public int damagemomentum;
public Sword( int x, int y,TiledTextureRegion texture, VertexBufferObjectManager OM)
{
super(x, y, texture, OM);
this.isSword = true;
this.leftSide = new Rectangle(0,30,32,4,OM);
this.rightSide = new Rectangle(32,30,32,4,OM);
leftSide.setVisible(false);
rightSide.setVisible(false);
this.attachChild(leftSide);
this.attachChild(rightSide);
bodyRect = new Rectangle(10,30, 44,4,OM);
this.attachChild(bodyRect);
self.setVisible(false);
bodyRect.setVisible(false);
this.setVisible(true);
}
@Override
public Rectangle AttackCollisionRect()
{
return bodyRect;
}
public void collect()
{
this.setVisible(false);
this.stopAnimation();
this.detachSelf();
}
public void reset()
{
this.setVisible(true);
}
}