-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHoldMandrake.cs
More file actions
86 lines (70 loc) · 2.05 KB
/
HoldMandrake.cs
File metadata and controls
86 lines (70 loc) · 2.05 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
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace monowizard
{
internal class HoldMandrake : HoldItem
{
int manasucktime = 0;
bool sucking = true;
int spawnoffsety = 0;
int spawnoffsetx = 0;
int partsize = 32;
int aniframes = 0;
public HoldMandrake(CollisionCheck check, Player player) : base(check, player)
{
this.id = 102;
this.player = player;
this.check = check;
holdoffset = 10;
xmidoffset = 25;
xleftholdoffset = -10;
xrightholdoffset = 40;
throwvel = 13;
spriteEffects = SpriteEffects.None;
xoffset = 15;
setDefaultValues();
}
public void setDefaultValues()
{
hitbox.X = 200;
hitbox.Y = 200;
hitbox.Width = 50;
hitbox.Height = 60;
croprect.X = 0;
croprect.Y = 0;
croprect.Width = 128;
croprect.Height = 128;
drawrect = new Rectangle(0, 0, 80, 80);
bounce = 5;
}
public override void update()
{
base.update();
aniframes++;
if (aniframes % 15 == 0)
{
croprect.X += 128;
if (croprect.X > 400)
{
croprect.X = 128;
}
}
}
public override void playeritemupdate()
{
update();
//itemupdate();
}
public override void draw(SpriteBatch _spriteBatch)
{
drawrect.X = (int)hitbox.X - xoffset - player.centerWorldX + player.centerX;
drawrect.Y = (int)hitbox.Y - player.centerWorldY + player.centerY;
_spriteBatch.Draw(texture, drawrect, croprect, Color.White, 0, Vector2.Zero, spriteEffects, 1);
}
}
}