poffertjesporum
kill system
On top of what cap5lut said, a thing to do for optimisation is to first check if the player and npc are within range of each other.
There is no need to check for collisions if things are not even able to hit each other.
You can also use that check as a simple proof of concept, if they are within range and you "fire", play the animation.
It also might be worth seeing how fallout does it or other games that implement stuff like critical kill animations.
11 replies
open a path
I thought by "I want it to open a path when I tap on one of the buttons" you meant that, sorry.
I would not know how else to do it, but with a quick google search I did find something that does open an .epub file for me through code.
That said, I can't say if this is the right way to do something like this. And you also need something that can open the files, in my case: SumatraPDF
https://stackoverflow.com/questions/32816364/programmatically-open-word-document-located-in-the-computer-in-c-sharp
10 replies
Weird behaviour with SpriteBatch.Draw in MonoGame
Hi! I'm not a coder chad, but I'll try and help even though I may be totally wrong.
Since the notes do show up. And they don't disappear
it means that they are drawn to screen each frame.
Given this I'd say the problem is in your update loop,
where you set the position of the notes.
Position = 100.0f + (float)Math.Sin(time) * 100;
What I think this line does is:
Set the y position of the note to the result of that equation
but since the equation bases of off a sine wave, it doesn't really go anywhere.
(Might be moving but sorta vibrating) And you use seconds so it would update each second,
might take a while before you see some actual displacement.
I'd say try a really basic thing like Position += 5;
This adds 5 to the y value each update.
And just as a little extra, I'd suggest putting Texture2D noteTexture = contentManager.Load<Texture2D>("NoteTexture");
In the constructor, you really only need to set a texture once. Setting it multiple times like this is a waste of resources.3 replies