I want to make a turn-based game where the player is given "opportunities for attack." An image of the in-game sprite character appears when it's the player's turn to attack. The player can mouseover the various parts of the image, which will highlight that specific body part, like so:    The player can then choose to attack that given body part.   To do this, I was thinking of adopting the "grid" method, and put my image within a 2D array... with each region of the body mapped to a certain square, like so:    Or, I could generate a pixelated version of the in-game sprite within a grid to begin with, so I would already have the mappings, like so:     I'm not sure:   how to partition the image up so that each section is represented meaningfully in the matrix if this is the right way of doing this   Any guidance would be helpful
Say for a game with irregular hotspots (say Risk, or a strategy game like Paradox's Hearts of Iron or Crusader Kings), how do you   Define a non-rectangular hotspot of irregular shape (much like a territory on a map?), in code? What tool can you use to trace out the hotspot and import into your game? What is the algorithm for detecting if someone has clicked within such a hotspot?
Does the plastic cap on a Presta valve serve any purpose once fitted to a rim? I can see the use of the valve cap on a Presta valve when the tube is still packaged (it obviously stops the valve puncturing the tube), but does it do anything except look pretty (or not) once you've fitted the tube to a rim?  I've kept them on out of habit, because I've had problems with sticking Schrader valves in the past when I've lost the caps and dirt/grime has got in there - but the design of Presta valves suggests to me that they wouldn't suffer this fate.  Given that I really need to , is replacing this cap something I can leave out of my daily chores? I have two examples of different scenarios that are confusing to me.  First, if I have a 1/1 creature with first strike and deathtouch, and my opponent blocks it with a 2/2 creature, will my creature die? I can see two alternative ways this could play out and I'm not sure which is correct.   My creature deals his first strike damage, immediately killing the opponent's creature before he is able to deal combat damage as a state-based effect. My creature deals his first strike damage, which would normally be lethal due to deathtouch, but state-based effects are not checked, and thus the opposing creature deals his damage and both die.   I'm almost positive in this case that it's the first option above.  What gets trickier is, for example, if a creature has first strike and a triggered ability "Whenever this creature deals combat damage to a creature, return that creature to its owner's hand."  This is not a state-based effect, but rather uses the stack. Similar to above, there are two possibilities.   My creature deals his first strike damage, and his triggered ability is placed on the stack. The stack waits to resolve until after all combat damage is dealt, so the opposing creature still kills mine. My creature deals his first strike damage, and his triggered ability is placed on the stack. Both players now gain priority between first strike and combat damage (which I don't think normally happens, thus my confusion). The stack finishes resolving, and the opponent's creature doesn't have a chance to deal damage.   Can someone clarify this area of the rules? Smileys in LaTeX I would like to include smileys in my LaTeX document. Is there any package with lots of different smileys?  In mnsymbol and wasysym, I found some general symbols:  \documentclass{article} \usepackage{MnSymbol,wasysym} \begin{document} wasysym: \smiley{} \frownie{} \blacksmiley{}  MnSymbol: \(\smile{} \frown{}\) \end{document}     But I do not like the output. Actually, I am looking for smileys which look like "default smiles" in Google Talk, MSN, ... ;) &lt;- this one is my favourite. ;) The following  (links to pdf) in the  has no provided source. The book  by Ash and Gross seems to use a similar style. Where can I find hints for typesetting publication standard articles/books as above in TeX. I looked around a bit but couldnt find much from else from keyword searches.  Particularly, I am looking at the chapter headings, title page design, and the mirror effect. Sorry for the title, as I dont really know what its called. How can i change formatting of the table of contents to avoid section numbering and section title to overlap?  Document:  \documentclass[10pt,oneside,notitlepage]{book}  % Use Heuristica Font \usepackage{heuristica} \usepackage[heuristica,vvarbb,bigdelims]{newtxmath} \renewcommand*\oldstylenums[1]{\textosf{#1}}   \begin{document}  \tableofcontents  \part{Part one}  \chapter{Chapter Oh} \chapter{Chapter Oh} \chapter{Chapter Oh} \chapter{Chapter Oh} \chapter{Chapter Oh} \chapter{Chapter Oh} \chapter{Chapter Oh} \chapter{Chapter Oh} \chapter{Chapter Oh} \chapter{Chapter Oh} \chapter{Chapter Oh} \chapter{Chapter Oh} \chapter{Chapter Oh} \chapter{Chapter Oh} \chapter{Chapter Oh} \chapter{Chapter Oh} \chapter{Chapter Oh} \chapter{Chapter Oh} \chapter{Chapter Oh} \chapter{Chapter Oh}   \section{Chapter Hi} \section{Chapter Hi} \section{Chapter Hi} \section{Chapter Hi} \section{Chapter Hi} \section{Chapter Hi} \section{Chapter Hi} \section{Chapter Hi} \section{Chapter Hi} \section{Chapter Hi}  \end{document}   Example output: "print()" is producing undesired output in Visual Studio Code Convert a matrix to a 1 dimensional array Will the Windows 10 Free Upgrade stay in the Professional channel? I have installed Ubuntu 12.04-64 bit on my Lenovo IdeaPad laptop, and the wired Ethernet (LAN) connection doesn't work.  Running the lspci -vv | grep Atheros command from the terminal shows me I have the AR8161 Gigabit Ethernet controller:  02:00.0 Ethernet controller: Atheros Communications Inc. AR8161 Gigabit Ethernet (rev 08)   This looks like a new product whose drivers are not built into Ubuntu.  How do I install drivers to get the AR8161 working? Two homologous but not homotopic loops on a closed surface of genus greater than one Suppose $S$ is a closed surface with genus greater than $1$. Give an example of two loops on $S$ which are not homotopic, but are homologous to each other.   I need help solving this question. I have read the Wikipedia page on it and I realize that it does not contain the necessary knowledge to visualize this problem.  And I was also wondering the relation between the fundamental group $\pi_1(S)$ and the first homology group $H_1(S)$? Some restrictions is that $S$ is a closed surface and the genus is greater than $1$. Given a command that changes its behaviour when its output is going to a terminal (e.g. produce coloured output), how can that output be redirected in a pipeline while preserving the changed behaviour?  There must be a utility for that, which I am not aware of.  Some commands, like grep --color=always, have option flags to force the behaviour, but the question is how to work around programs that rely solely on testing their output file descriptor.  If it matters, my shell is bash on Linux. Reference undefined in \section with amsbook I have a section that is devoted to the proof of a theorem, and hence I used  \section{Proof of Theorem~\ref{thm}}   Of course, because of the headers that are capitalized, it asks for \ref{THM} when producing the header, and I get an obvious error. What is the proper way to handle such a case? Below is a MWE:  \documentclass{amsbook} \usepackage{lipsum} \newtheorem{thm}{Theorem} \begin{document} \chapter{First Chapter} \section{The Theorem} \begin{thm}[Lipsum Theorem] \label{thm} \lipsum[1] \end{thm} \section{Proof of Theorem~\ref{thm}} \lipsum[1-23] \end{document}   When compiling I get:  LaTeX Warning: Reference `THM' on page 3 undefined on input line 14.   (each time it produces a header), and the header shows     `2. PROOF OF THEOREM ??' How to deal with high correlation among predictors in multiple regression? When do we not put a comma before "because"? In what situation do you put a comma before "because"?   And, when do you not put a comma before "because"?   I've always assumed that you put a comma, because the clause introduced by "because" will always be independent, because it cannot stand on its own, because it wouldn't make sense on its own.   Is this the case? Could you think of an example where it doesn't take a comma? I have the following code and I expect the resulting angle to be 135 degrees but whatevet I try, I get 90.  \documentclass{article} \usepackage{tikz} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture}  \coordinate (A) at (1,0); \coordinate (B) at (-1,1);  \pgfmathanglebetweenpoints{A}{B} \edef\angleAB{\pgfmathresult} \node at (0,0) {\angleAB};  \end{tikzpicture} \end{document}   I also tried the following command without knowing what it means, it also prints 90 except one case. The only working case is when A=(1,0) and B=(-1,0), which it prints 180.  \pgfmathanglebetweenpoints{\pgfpointanchor{A}{center}}{\pgfpointanchor{B}{center}}   Why is that? Couldn't find any reference document for "pgfmathanglebetweenpoints" by the way, that's why I am asking here.  EDIT: B is corrected from (-1,-1) to (-1,1) Auto-run scripts security options Multiple forms in delphi What is the meaning of this two letter code in the YouTube logo? I see a new logo with CA at youtube.com. Does anyone know what it means? How to install Ubuntu 18.04 alongside Windows 10 Every affine variety in $\mathbb A^n$ consisting of finitely many points can be written as the zero locus of $n$ polynomials I am reading Gathmann's free online notes on Algebraic Geometry. One exercise asks to show that     "Every affine variety in $\mathbb A^n$ consisting of finitely many points can be written as the zero locus of $n$ polynomials".    There is a hint says "interpolation". I don't know how to start with the hint.   If $n=2$, we can use interpolation to get 1 polynomial for finitely many points. But we need to show 2 polynomials instead. I am also not sure how to apply interpolation for higher dimensions. Anyone can help? Thank you!