mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
This commit is contained in:
parent
5719344653
commit
8b962f8446
111 changed files with 288 additions and 223 deletions
|
@ -18,7 +18,7 @@ struct Point {
|
|||
|
||||
struct App {
|
||||
mut:
|
||||
tui &tui.Context = unsafe { 0 }
|
||||
tui &tui.Context = unsafe { nil }
|
||||
points []Point
|
||||
color tui.Color = colors[0]
|
||||
color_idx int
|
||||
|
|
|
@ -2,7 +2,7 @@ import term.ui as tui
|
|||
|
||||
struct App {
|
||||
mut:
|
||||
tui &tui.Context = unsafe { 0 }
|
||||
tui &tui.Context = unsafe { nil }
|
||||
}
|
||||
|
||||
fn event(e &tui.Event, x voidptr) {
|
||||
|
|
|
@ -19,11 +19,11 @@ const (
|
|||
[heap]
|
||||
struct App {
|
||||
mut:
|
||||
tui &ui.Context = unsafe { 0 }
|
||||
tui &ui.Context = unsafe { nil }
|
||||
mode Mode = Mode.menu
|
||||
width int
|
||||
height int
|
||||
game &Game = unsafe { 0 }
|
||||
game &Game = unsafe { nil }
|
||||
dt f32
|
||||
ticks i64
|
||||
}
|
||||
|
@ -191,7 +191,7 @@ fn (mut a App) draw_game() {
|
|||
|
||||
struct Player {
|
||||
mut:
|
||||
game &Game
|
||||
game &Game = unsafe { nil }
|
||||
pos Vec
|
||||
racket_size int = 4
|
||||
score int
|
||||
|
@ -242,7 +242,7 @@ fn (mut b Ball) update(dt f32) {
|
|||
[heap]
|
||||
struct Game {
|
||||
mut:
|
||||
app &App = unsafe { 0 }
|
||||
app &App = unsafe { nil }
|
||||
players []Player
|
||||
ball Ball
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ mut:
|
|||
|
||||
struct App {
|
||||
mut:
|
||||
tui &tui.Context = unsafe { 0 }
|
||||
tui &tui.Context = unsafe { nil }
|
||||
rects []Rect
|
||||
cur_rect Rect
|
||||
is_drag bool
|
||||
|
|
|
@ -90,7 +90,7 @@ const (
|
|||
|
||||
struct App {
|
||||
mut:
|
||||
ui &ui.Context = unsafe { 0 }
|
||||
ui &ui.Context = unsafe { nil }
|
||||
header_text []string
|
||||
mouse_pos Point
|
||||
msg string
|
||||
|
|
|
@ -57,8 +57,8 @@ pub:
|
|||
|
||||
struct App {
|
||||
mut:
|
||||
tui &tui.Context = unsafe { 0 }
|
||||
ed &Buffer = unsafe { 0 }
|
||||
tui &tui.Context = unsafe { nil }
|
||||
ed &Buffer = unsafe { nil }
|
||||
current_file int
|
||||
files []string
|
||||
status string
|
||||
|
|
|
@ -71,7 +71,7 @@ mut:
|
|||
// snake representation
|
||||
struct Snake {
|
||||
mut:
|
||||
app &App
|
||||
app &App = unsafe { nil }
|
||||
direction Orientation
|
||||
body []BodyPart
|
||||
velocity Vec = Vec{
|
||||
|
@ -247,7 +247,7 @@ mut:
|
|||
}
|
||||
captured bool
|
||||
color termui.Color = grey
|
||||
app &App
|
||||
app &App = unsafe { nil }
|
||||
}
|
||||
|
||||
// randomize spawn the rat in a new spot within the playable field
|
||||
|
@ -259,7 +259,7 @@ fn (mut r Rat) randomize() {
|
|||
[heap]
|
||||
struct App {
|
||||
mut:
|
||||
termui &termui.Context = unsafe { 0 }
|
||||
termui &termui.Context = unsafe { nil }
|
||||
snake Snake
|
||||
rat Rat
|
||||
width int
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue