-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHoldSkullShroom.cs
More file actions
82 lines (66 loc) · 1.93 KB
/
HoldSkullShroom.cs
File metadata and controls
82 lines (66 loc) · 1.93 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
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 HoldSkullShroom : HoldItem
{
int aniframes = 0;
public HoldSkullShroom(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 = 10;
setDefaultValues();
ingId = 1;
}
public void setDefaultValues()
{
hitbox.X = 200;
hitbox.Y = 200;
hitbox.Width = 50;
hitbox.Height = 60;
croprect.X = 512;
croprect.Y = 0;
croprect.Width = 128;
croprect.Height = 128;
drawrect = new Rectangle(0, 0, 80, 80);
bounce = 5;
}
public override void playeritemupdate()
{
update();
//itemupdate();
}
public override void update()
{
base.update();
aniframes++;
if (aniframes % 15 == 0)
{
croprect.X += 128;
if (croprect.X > 1000)
{
croprect.X = 512;
}
}
}
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);
}
}
}