私は iOS 開発は初めてなので、簡単なゲームから始めることにしました: 三目並べ
ユーザーがマークを自由に描画できるようにするための難易度を追加しました。たとえば、これらのマークを含むスロットからマークを選択するのではなく、円または十字を描きます。これは、現実の世界でペンとピースを使用してこのゲームをプレイするのと同じです。紙の。
ここでの問題は、ユーザーがボード上に円または十字を描いたかどうかをどのように知ることができるかということです。アドバイスや参照リンクは大歓迎です。
私は iOS 開発は初めてなので、簡単なゲームから始めることにしました: 三目並べ
ユーザーがマークを自由に描画できるようにするための難易度を追加しました。たとえば、これらのマークを含むスロットからマークを選択するのではなく、円または十字を描きます。これは、現実の世界でペンとピースを使用してこのゲームをプレイするのと同じです。紙の。
ここでの問題は、ユーザーがボード上に円または十字を描いたかどうかをどのように知ることができるかということです。アドバイスや参照リンクは大歓迎です。
Circle can be drawn without lifting finger. If the start (touch down) end (touch up) are fairly close to each other and you have a fair amount of in between points you have a circle. You can improve this by computing major and minor radius and see how the points fit around an oval with those radii.
Cross it's composed of two drawing operations if you consider touch down and up an operation. Check if the distance between the start and end is fairly larger. When he draws the second line check if they intersect. If they intersect its most likely a cross. You could further improve by checking how well the points fit along a line that goes from first point to last point (touch down touch up)
This is a simple way to check. Of course there are situations where this method could fail miserably. But unless you want to get into more complicated stuff this should work fairly well.