Android Spiele-Layout umsetzen

bennemann8

Mitglied
Hallo zusammen,

mir fehlt irgendwie der Ansatz, wie ich das im Anhang eingefügte Layout als Android-App umsetzen kann.
Es soll quasi ein 1on1 Minigame werden.

Prinzip:
er erscheint beiden Spielern eine Farbe als Wort, in einer bestimmten Schriftfarbe.
Stimmen Wort und Farbe überein, drückt man den Knopf der Farbe.
Stimmt der Text nicht mit der Textfarbe überein, muss der Knopf der 3. Farbe gedrückt werden.


Die Logik ist nicht das Problem, sondern die Umsetzung des Layouts, damit man das auch als 1on1 spielen kann.
Ich hoffe ihr könnt mir da weiterhelfen und versteht, was ich umsetzen möchte :D


Gruß
bennemann8
 

Anhänge

  • skizze.JPG
    skizze.JPG
    21,3 KB · Aufrufe: 27

dzim

Top Contributor
Code:
LinearLayout (Horizontal, h: match_parent, w: match_parent)
|
|- LinearLayout (Vertikal, h: match_parent, w: wrap_content)
|  |- Button Oben (h: 0dp, w: wrap_content, weight: 1)
|  |- Button Mitte (h: 0dp, w: wrap_content, weight: 1)
|  \- Button Unten (h: 0dp, w: wrap_content, weight: 1)
|
|- LinearLayout (Vertikal, h: match_parent, w: wrap_content)
|  \- TextView (hier bin ich unsicher, es muss ja um +90° rotiert werden, musst du experimentieren)
|
\- LinearLayout (Vertikal, h: match_parent, w: wrap_content)
|  \- TextView (hier bin ich unsicher, es muss ja um -90° rotiert werden, musst du experimentieren)
|
\- LinearLayout (Vertikal, h: match_parent, w: wrap_content)
   |- Button Oben (h: 0dp, w: wrap_content, weight: 1)
   |-´Button Mitte (h: 0dp, w: wrap_content, weight: 1)
   \- Button Unten (h: 0dp, w: wrap_content, weight: 1)

In etwa klar, was ich meine? Du musst hier einfach ein wenig mit den Weights der einzelnen Komponenten herumspielen. Vielleicht ginge auch ein 4*3 Felder grosses GridLayout. Ich glaube, dass du auch hier mit den Gewichten herumspielen könntest.
 
Zuletzt bearbeitet:

bennemann8

Mitglied
Code:
LinearLayout (Horizontal, h: match_parent, w: match_parent)
|
|- LinearLayout (Vertikal, h: match_parent, w: wrap_content)
|  |- Button Oben (h: 0dp, w: wrap_content, weight: 1)
|  |- Button Mitte (h: 0dp, w: wrap_content, weight: 1)
|  \- Button Unten (h: 0dp, w: wrap_content, weight: 1)
|
|- LinearLayout (Vertikal, h: match_parent, w: wrap_content)
|  \- TextView (hier bin ich unsicher, es muss ja um +90° rotiert werden, musst du experimentieren)
|
\- LinearLayout (Vertikal, h: match_parent, w: wrap_content)
|  \- TextView (hier bin ich unsicher, es muss ja um -90° rotiert werden, musst du experimentieren)
|
\- LinearLayout (Vertikal, h: match_parent, w: wrap_content)
   |- Button Oben (h: 0dp, w: wrap_content, weight: 1)
   |-´Button Mitte (h: 0dp, w: wrap_content, weight: 1)
   \- Button Unten (h: 0dp, w: wrap_content, weight: 1)

In etwa klar, was ich meine? Du musst hier einfach ein wenig mit den Weights der einzelnen Komponenten herumspielen. Vielleicht ginge auch ein 4*3 Felder grosses GridLayout. Ich glaube, dass du auch hier mit den Gewichten herumspielen könntest.

ich denke schon.
.ich muss mal sehen, wie ich das so in der Art in mein Grundgerüst unterbringen kann :D
Ich arbeite mit dem Grundgerüst von KiloBolt bzw. basteldroid
Es werden keine eigenen .xml als Layout verwendet, sondern es wird allein mit "Screen" Klassen gearbeitet.
Aber mir ist gerade eine Idee gekommen, wie es evtl. machbar ist.

Danke schon mal!! :)
 

dzim

Top Contributor
Ja natürlich geht das auch ohne XML! Aber letzten Endes wird das XML eh nur in die gleichnamigen Klassen übersetzt, daher kannst du mit dem gleichen Ansatz das Selbe auch im Code erreichen - ist vielleicht etwas umständlicher, sollte aber mit mäßigen Aufwand möglich sein, wenn man ein Layout "vor Augen" hat...
 
Ähnliche Java Themen
  Titel Forum Antworten Datum
D Android Spiele Programmierung Buch Android & Cross-Platform Mobile Apps 2
J Bücher über Java-Spiele-Programmierung Android & Cross-Platform Mobile Apps 3
B Java-Spiele bzw -Anwendungen Android & Cross-Platform Mobile Apps 7
W Ausklappbares Verlängertes XML Layout Android & Cross-Platform Mobile Apps 6
W Android Wieso kann ich keine ListView mehr zum Layout hinzufügen? Android & Cross-Platform Mobile Apps 1
A Android-Studio: 2. Layout nach kurzer Zeit aufzeigen Android & Cross-Platform Mobile Apps 2
S Android Layout - welchen Typ? Android & Cross-Platform Mobile Apps 3
B Android Multiple Screens- layout-sw600dp Android & Cross-Platform Mobile Apps 1
D Android Layout für alle Geräte Android & Cross-Platform Mobile Apps 4
W Android Designfrage / Layout / Activity / Fragments Android & Cross-Platform Mobile Apps 2
B Layout Bibliothek Android & Cross-Platform Mobile Apps 8
O zurück Schaltfläche in voriges Layout Android & Cross-Platform Mobile Apps 5
B Erste Android-App: setContentView(R.layout.main) funktioniert nicht Android & Cross-Platform Mobile Apps 6
D Android Viele Buttons und ein Layout Android & Cross-Platform Mobile Apps 6
M Android Game, welche Layout? Android & Cross-Platform Mobile Apps 2
B Eigene View xml-Layout einbinden Android & Cross-Platform Mobile Apps 1
R Android Layout Bild mit Text Android & Cross-Platform Mobile Apps 13
K Rand bei (Table,Relative,Linear)Layout - wie bekomme ich ihn weg? Android & Cross-Platform Mobile Apps 3
D Android Layout Problem Android & Cross-Platform Mobile Apps 2
P Android Nach Animation Layout auf alten Platz Android & Cross-Platform Mobile Apps 3
T Android Layout Update Animation Android & Cross-Platform Mobile Apps 3
P Probleme mit xml-Layout Android & Cross-Platform Mobile Apps 2
W XML Layout: wann wird geladen? Android & Cross-Platform Mobile Apps 10
F Layout mit listViews (Scrolling-Probleme) Android & Cross-Platform Mobile Apps 2
G Fehlermeldung: "No XML content. Please add a root view or layout to your documet." Android & Cross-Platform Mobile Apps 7
N Android xml - graphical layout nur noch weiß :o Android & Cross-Platform Mobile Apps 4
T Android Merkwürdigkeiten im Layout Android & Cross-Platform Mobile Apps 7
JAVAnnik Android Layout ändern in Thread Android & Cross-Platform Mobile Apps 2
A Android Browser öffnen, XML-GUI-Layout Android & Cross-Platform Mobile Apps 23
A Absolute Layout soll auf jedem Gerät gleich aussehen Android & Cross-Platform Mobile Apps 4
S Android Layout Problem mit fill_parent Android & Cross-Platform Mobile Apps 5
tfa Android Layout-Probleme: View programmatisch erweitern (addContentView) Android & Cross-Platform Mobile Apps 7
L Stundenplan (wie umsetzen) Android & Cross-Platform Mobile Apps 1
B Android Design umsetzen Android & Cross-Platform Mobile Apps 3

Ähnliche Java Themen

Neue Themen


Oben