Author Topic: INPUT magazine  (Read 33122 times)

Offline matchy

  • Prof. Inline
  • *****
  • Posts: 1544
    • View Profile
Re: INPUT magazine
« Reply #105 on: 2014-May-04 »

Alrighty.  ;) Something I scratched up today. To test, I cut and paste the coco.txt in to mess emulator. :)

Code: (glbasic) [Select]
// --------------------------------- //
// Project: cocochr
// Start: Saturday, May 03, 2014
// IDE Version: 11.414

// coco char painter by matchy
// Default artwork by Erico
//
// SPACEBAR: Saves image data and code to user documents folder (coco.dat, coco.txt)
// Key 1 - 8: Select color
// Key 0: Select black
// Shift Key: Pen down
// C: Clear screen to black

TYPE _pal
id
anim
silver = 0xc0c0c0
gray = 0x808080
tin = 0x404040
green = 0x00ff00
yellow = 0x00ffff
blue = 0xff0000
red = 0x0000ff
white = 0xffffff
cyan = 0xff8000
magenta = 0xff0080
orange = 0x0080ff
black = 0x000000
ENDTYPE

TYPE _rect
x
y
width
height
width2
height2
ENDTYPE

TYPE _mouse
x
y
b1
b2
b1_last
b2_last
ENDTYPE

TYPE _code
line$[]
count
start = 100
ENDTYPE

TYPE _file
ok
channel
name$
reading
documents$
ENDTYPE

GLOBAL screen AS _rect
GLOBAL grid AS _rect
GLOBAL tool AS _rect
GLOBAL plot AS _rect
GLOBAL pal AS _pal
GLOBAL mouse AS _mouse
GLOBAL map[]
GLOBAL map_chr[]
GLOBAL code AS _code
GLOBAL file AS _file

loop()

FUNCTION get_color: id
LOCAL col
SELECT id
CASE 1
col = pal.green
CASE 2
col = pal.yellow
CASE 3
col = pal.blue
CASE 4
col = pal.red
CASE 5
col = pal.white
CASE 6
col = pal.cyan
CASE 7
col = pal.magenta
CASE 8
col = pal.orange
CASE 0
col = pal.black
DEFAULT
col = pal.black
ENDSELECT
RETURN col
ENDFUNCTION

FUNCTION draw_grid:
LOCAL x0, y0, x1, y1, width, height, col
width = screen.width / grid.width
height = screen.height / grid.height
FOR x = 0 TO grid.width - 1
x0 = x * width
y0 = 0
x1 = x * width
y1 = screen.height
IF MOD(x, 2) = 0
col = pal.gray
ELSE
col = pal.tin
ENDIF
DRAWLINE x0, y0, x1, y1, col

NEXT
FOR y = 0 TO grid.height - 1
x0 = 0
y0 = y * height
x1 = screen.width
y1 = y * height
IF MOD(y, 2) = 0
col = pal.gray
ELSE
col = pal.tin
ENDIF
DRAWLINE x0, y0, x1, y1, col
NEXT
ENDFUNCTION

FUNCTION setup:
SYSTEMPOINTER TRUE
GETSCREENSIZE screen.width, screen.height
grid.width = 64
grid.height = 32
grid.width2 = grid.width / 2
grid.height2 = grid.height / 2
plot.width = screen.width / grid.width
plot.height = screen.height / grid.height
DIM map[grid.width][grid.height]
DIM map_chr[grid.width2][grid.height2]
DIM code.line$[0]
file.documents$ = PLATFORMINFO$("DOCUMENTS")
load_data()
ENDFUNCTION

FUNCTION draw_box: x, y, width, height, color
DRAWLINE x, y, x, y + height, color
DRAWLINE x, y + height, x + width, y + height, color
DRAWLINE x + width, y + height, x + width, y, color
DRAWLINE x + width, y, x, y, color
ENDFUNCTION

FUNCTION load_data:
LOCAL data$, i, ln$[]
file.channel = GENFILE()
file.reading = TRUE
file.name$ = file.documents$ + "/coco.dat"
DEBUG "load file:" + file.name$ + "\n"
file.ok = OPENFILE(file.channel, file.name$, file.reading)
IF file.ok
FOR y = 0 TO grid.height - 1
READLINE file.channel, data$
i = SPLITSTR(data$, ln$[], ",")
FOR x = 0 TO grid.width - 1
map[x][y] = ln$[x]
NEXT
NEXT
CLOSEFILE file.channel
DEBUG "loaded:" + file.name$ + "\n"
ELSE
RESTORE erico_karate
FOR y = 0 TO grid.height -1
FOR x = 0 TO grid.width - 1
READ map[x][y]
NEXT
NEXT
DEBUG "No file:" + file.name$ + "\n"
DEBUG "Default image restored\n"
save_data()
ENDIF
ENDFUNCTION

FUNCTION save_data:
LOCAL data$, r$
file.channel = GENFILE()
file.reading = FALSE
file.name$ = file.documents$ + "/coco.dat"
file.ok = OPENFILE(file.channel, file.name$, file.reading)
IF file.ok
FOR y = 0 TO grid.height - 1
data$ = ""
FOR x = 0 TO grid.width - 1
IF x > 0
INC data$, ","
ENDIF
INC data$, map[x][y]
NEXT
WRITELINE file.channel, data$
// INC r$, "DATA "
// INC r$, data$
// INC r$, "\n"
NEXT
CLOSEFILE file.channel
DEBUG "Saved: " + file.name$ + "\n"
DEBUG r$
ELSE
DEBUG "Not saved: " + file.name$ + "\n"

ENDIF
ENDFUNCTION

FUNCTION clear_map:
FOR y = 0 TO grid.height - 1
FOR x = 0 TO grid.width - 1
map[x][y] = pal.black
NEXT
NEXT
ENDFUNCTION

FUNCTION loop_mouse:
LOCAL col, px, py, pal_id_temp
mouse.b1_last = mouse.b1
mouse.b2_last = mouse.b2
MOUSESTATE mouse.x, mouse.y, mouse.b1, mouse.b2
IF mouse.x < 0 OR mouse.x > screen.width - 1 OR mouse.y < 0 OR mouse.y > screen.height - 1
RETURN
ENDIF
INC pal.anim
IF pal.anim = 50 THEN pal.anim = 0
grid.x = INTEGER(mouse.x / plot.width)
grid.y = INTEGER(mouse.y / plot.height)
plot.x = grid.x * plot.width
plot.y = grid.y * plot.height
px = MOD(grid.x, 2)
py = MOD(grid.y, 2)
IF mouse.b1_last <> mouse.b1 = 1 OR KEY(42) // shift
IF mouse.b1 = 1
map[grid.x + 0][grid.y + 0] = pal.id
IF pal.id > pal.black
IF px = 0 AND py = 0
IF map[grid.x - 0][grid.y + 0] > pal.black
map[grid.x - 0][grid.y + 0] = pal.id
ENDIF
IF map[grid.x - 0][grid.y + 1] > pal.black
map[grid.x - 0][grid.y + 1] = pal.id
ENDIF
IF map[grid.x + 1][grid.y - 0] > pal.black
map[grid.x + 1][grid.y - 0] = pal.id
ENDIF
IF map[grid.x + 1][grid.y + 1] > pal.black
map[grid.x + 1][grid.y + 1] = pal.id
ENDIF
ENDIF
IF px = 1 AND py = 0
IF map[grid.x - 0][grid.y + 0] > pal.black
map[grid.x - 0][grid.y + 0] = pal.id
ENDIF
IF map[grid.x - 0][grid.y + 1] > pal.black
map[grid.x - 0][grid.y + 1] = pal.id
ENDIF
IF map[grid.x - 1][grid.y - 0] > pal.black
map[grid.x - 1][grid.y - 0] = pal.id
ENDIF
IF map[grid.x - 1][grid.y + 1] > pal.black
map[grid.x -1][grid.y + 1] = pal.id
ENDIF
ENDIF
IF px = 0 AND py = 1
IF map[grid.x - 0][grid.y + 0] > pal.black
map[grid.x - 0][grid.y + 0] = pal.id
ENDIF
IF map[grid.x - 0][grid.y - 1] > pal.black
map[grid.x - 0][grid.y - 1] = pal.id
ENDIF
IF map[grid.x + 1][grid.y - 0] > pal.black
map[grid.x + 1][grid.y - 0] = pal.id
ENDIF
IF map[grid.x - 1][grid.y + 1] > pal.black
map[grid.x - 1][grid.y - 1] = pal.id
ENDIF
ENDIF
IF px = 1 AND py = 1
IF map[grid.x - 0][grid.y + 0] > pal.black
map[grid.x - 0][grid.y + 0] = pal.id
ENDIF
IF map[grid.x - 0][grid.y - 1] > pal.black
map[grid.x - 0][grid.y - 1] = pal.id
ENDIF
IF map[grid.x - 1][grid.y - 0] > pal.black
map[grid.x - 1][grid.y - 0] = pal.id
ENDIF
IF map[grid.x - 1][grid.y - 1] > pal.black
map[grid.x - 1][grid.y - 1] = pal.id
ENDIF
ENDIF
ENDIF
ENDIF
ELSEIF mouse.b2_last <> mouse.b2 = 1
IF mouse.b2 = 1
INC pal.id
IF pal.id > 8
pal.id = 0
ENDIF
ENDIF
ENDIF
IF pal.anim < 10
col = pal.tin
ELSE
col = get_color(pal.id)
ENDIF
DRAWRECT plot.x, plot.y, plot.width, plot.height, col
IF px > 0
DEC plot.x, plot.width
ENDIF
IF py > 0
DEC plot.y, plot.height
ENDIF
draw_box(plot.x, plot.y, plot.width * 2, plot.height * 2, pal.white)
LOCAL i$ = INKEY$()
IF i$ <> ""
SELECT i$
CASE "c"
clear_map()
CASE "l"
load_data()
// CASE "s"
// save_data()
CASE " "
save_all()
CASE "0"
pal.id = 0
CASE "1"
pal.id = 1
CASE "2"
pal.id = 2
CASE "3"
pal.id = 3
CASE "4"
pal.id = 4
CASE "5"
pal.id = 5
CASE "6"
pal.id = 6
CASE "7"
pal.id = 7
CASE "8"
pal.id = 8
ENDSELECT
ENDIF
ENDFUNCTION

FUNCTION save_all:
save_data()
set_chr()
make_output()
// view_output()
save_code()
code.count = 0
REDIM code.line$[0]

ENDFUNCTION

FUNCTION draw_plot:
LOCAL col
FOR y = 0 TO grid.height - 1
FOR x = 0 TO grid.width - 1
plot.x = x * plot.width
plot.y = y * plot.height
col = get_color(map[x][y])
DRAWRECT plot.x, plot.y, plot.width, plot.height, col
NEXT
NEXT
ENDFUNCTION

FUNCTION set_chr:
LOCAL pc[], cc
DIM pc[4]
FOR y = 0 TO grid.height - 1 STEP 2
FOR x = 0 TO grid.width - 1 STEP 2
pc[0] = map[x + 1][y + 1]
pc[1] = map[x + 0][y + 1]
pc[2] = map[x + 1][y + 0]
pc[3] = map[x + 0][y + 0]
map_chr[x / 2][y / 2] = 0
FOR o = 0 TO 3
IF pc[o] > 0
INC map_chr[x / 2][y / 2], POW(2, o)
ENDIF
NEXT

pc[0] = (map[x + 1][y + 1] - 1) * 16
pc[1] = (map[x + 0][y + 1] - 1) * 16
pc[2] = (map[x + 1][y + 0] - 1) * 16
pc[3] = (map[x + 0][y + 0] - 1) * 16
FOR o = 0 TO 3
IF pc[o] > 0
INC map_chr[x / 2][y / 2], pc[o]
BREAK
ENDIF
NEXT
NEXT
NEXT
ENDFUNCTION

FUNCTION add_code: line$, num_flag
code.count = BOUNDS(code.line$[], 0) + 1
REDIM code.line$[code.count]
IF num_flag
INC code.line$[code.count - 1], ((code.count * 10) + code.start) + " "
ENDIF
INC code.line$[code.count - 1], line$
INC code.count
ENDFUNCTION

FUNCTION make_output:
LOCAL n$
add_code("CLS", FALSE)
add_code("NEW", FALSE)
add_code("'", TRUE)
add_code("CLS 0", TRUE)
add_code("FOR I = 0 to 510", TRUE)
add_code("READ NN", TRUE)
add_code("CC = 128 + NN", TRUE)
add_code("PRINT CHR$(CC);", TRUE)
add_code("NEXT", TRUE)
add_code("GOTO " + ((code.count * 10) + code.start), TRUE)
add_code("'", TRUE)
FOR y = 0 TO grid.height2 - 1
n$ = "DATA "
FOR x = 0 TO grid.width2 - 1
IF x > 0
INC n$, ","
ENDIF
INC n$, "&H" + UCASE$(HEX$(map_chr[x][y]))
NEXT
add_code(n$, TRUE)
NEXT
add_code("RUN", FALSE)
ENDFUNCTION

FUNCTION view_output:
LOCAL n$ = "\nCLEAR\n\nNEW\n"
FOR l = 0 TO code.count - 2
INC n$, code.line$[l]
INC n$, "\n"
NEXT
INC n$, "\nRUN\n"
DEBUG n$
ENDFUNCTION

FUNCTION save_code:
LOCAL data$
file.channel = GENFILE()
file.reading = FALSE
file.name$ = file.documents$ + "/coco.txt"
file.ok = OPENFILE(file.channel, file.name$, file.reading)
IF file.ok
FOR l = 0 TO code.count - 2
WRITELINE file.channel, code.line$[l]
NEXT
CLOSEFILE file.channel
DEBUG "code saved: " + file.name$ + " (" + code.count + ")" + "\n"
ELSE
DEBUG "code not saved: " + file.name$ + "\n"
ENDIF
ENDFUNCTION

FUNCTION loop:
setup()
WHILE TRUE
CLEARSCREEN
draw_plot()
draw_grid()
loop_mouse()
SHOWSCREEN
WEND
ENDFUNCTION

STARTDATA erico_karate:
DATA 0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4
DATA 4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0
DATA 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4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,1,1,1,1,0,8,8,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,8,8,0,1,1,1,1,0,8,8,0,1,1,1,1,1,1,1,1,1,1
DATA 0,0,0,0,0,1,1,1,1,1,0,8,8,0,1,1,1,1,0,8,8,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,8,8,0,1,1,1,1,0,8,8,0,1,1,1,1,1,1,1,1,1,1
DATA 0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1
DATA 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
ENDDATA

Offline erico

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 4306
    • View Profile
    • Portfolio
Re: INPUT magazine
« Reply #106 on: 2014-May-04 »
SUPER! :good:

Works wonders!
I like the dat file too.

Great job, a few touch buttons and a coco chr painter could be running on android!
You could also expand the painter to ascii 16 colors too.

I will deeply examine things later!

Any luck printing chr fast on a real coco? I saw there is a poke command to plot chr but did not have a chance to give it a go yet.
I also never used it, I feared pookes back then as it could crash the machine... :-[

Offline matchy

  • Prof. Inline
  • *****
  • Posts: 1544
    • View Profile
Re: INPUT magazine
« Reply #107 on: 2014-May-04 »
It's really cool of you to test it out Erico. Perhaps you or anyone else would like to try some art. I will later  :bed: and then check out the fast sprites stuff.  :good:

Offline erico

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 4306
    • View Profile
    • Portfolio
Re: INPUT magazine
« Reply #108 on: 2014-May-05 »
Gave a quick test a few days ago, had that layer program going too to try a r-type gfx, the app crash closed at one point I don´t know why.
I also see when using a tablet, some dots get pasted on a position that is not the mouse one.
I´m also sure I saw a mix of the last fenomena happening and plotting and illegal color here and there (ye more then 2 colors per block).

I will do the r-type again soon, an auto save would come handy or a way to load the dat file so if anything happen we don´t lose the image.
Maybe hitting space every now and then?...and if it crashes, paste the .dat on the GLB code default image? That would work right?

I know this was a quick code you did, but I thought about a couple things that would be nice to implement.
1-a way to layer an image for sketch and choose its transparency level.
2-interface wise, press and hold space and a circle appears around the cursor with the available colors, hover at one and release space to select.

Again, I´m marveled at it, gave a quick look at code and it is sure way above my ability to understand what is happening. :sick:

edit: YE I´ve noticed if you space save it, next time you load the project, it uses the saved .dat
It also crashed again, using mouse only, am not sure why, I was using the [shift] when it happened.
« Last Edit: 2014-May-05 by erico »

Offline matchy

  • Prof. Inline
  • *****
  • Posts: 1544
    • View Profile
Re: INPUT magazine
« Reply #109 on: 2014-May-05 »
Already, pressing space-bar will save the image and create the code. There is a bug in placing the pixels, such as placing one in upper left when lower right in the black char quad. I'm sure I could continue with the bugs and then implement more tools, such as palette selection, shape draw and fills. Recently, I tried to convert to c64 basic and perhaps others later (speccy, apple, etc) also but it's all experimental and just a team tool aid to what we really want to simply achieve, a (multiplatform/coco chr) adventure game (starting with story mapping and theme) as I don't think there is much hope for large chr sprites for an action game.

Offline erico

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 4306
    • View Profile
    • Portfolio
Re: INPUT magazine
« Reply #110 on: 2014-May-13 »
Well, sometime ago I tried a mock with it, but It crashed and I didn´t save it, but I re-did it in photoshop just in case.
Here is it, Can´t remember which game is that though... :P

It is scaled to look better here.

Offline matchy

  • Prof. Inline
  • *****
  • Posts: 1544
    • View Profile
Re: INPUT magazine
« Reply #111 on: 2014-May-13 »
Looks cool and reminds me of Protector II.
http://www.lcurtisboyle.com/nitros9/protectorii.html.

So how about some static sceneries for an adventure game?

Offline erico

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 4306
    • View Profile
    • Portfolio
Re: INPUT magazine
« Reply #112 on: 2014-May-14 »
What do you have in mind as an adventure? For the real coco? Which resolution?

Offline matchy

  • Prof. Inline
  • *****
  • Posts: 1544
    • View Profile
Re: INPUT magazine
« Reply #113 on: 2014-May-14 »
I am sort of leaving the main story line until I have a framework to make it on. Although I would like to have a good story, coincidentally, I'm currently experimenting with a multiplayer map, where players can create adjacent lots/scenes.

Right now, I think testing screens will do. For example, scenes like IK+ where we can use it for an action or adventure game. Alternatively, I wonder is tiling would be a choice, like with The Last Ninja.


Offline erico

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 4306
    • View Profile
    • Portfolio
Re: INPUT magazine
« Reply #114 on: 2015-Oct-21 »
Just a little note to Matchy here.
We were talking about the graphics mode on those images above, as how cool would it be if we could move those graphics at a good speed on the real coco.

I stumbled into this page here, where the guy does basic coding for the pre-coco computers and it seems he can make it move fast enough.
Check the whole blog, it is a good read.

http://jimgerrie.blogspot.com.br/

I love the ugliness of those chunky graphics! I shall do a GLB game with that restriction at one point! :)

Offline matchy

  • Prof. Inline
  • *****
  • Posts: 1544
    • View Profile
Re: INPUT magazine
« Reply #115 on: 2015-Oct-22 »
Yeah I know about Jim's for a long while now and it's where I get some tips from.

erico, let's get back next year and start on this game!  :D :D :D :D :D :D :D :D

Offline erico

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 4306
    • View Profile
    • Portfolio
Re: INPUT magazine
« Reply #116 on: 2015-Oct-22 »
Not impossible, time frame is looking ok on time to come. :good:

Your code do deserve a place on snipets though, it is really cool stuff on many fronts! :booze:

I have prepared some stuff for a low res game... it has a strong adventure part and it could be visually done on a coco since I´m going for a lot less. ;)
Maybe we could team up.

Offline matchy

  • Prof. Inline
  • *****
  • Posts: 1544
    • View Profile
Re: INPUT magazine
« Reply #117 on: 2015-Oct-22 »
We really need to design and build an simple adventure engine for now. If you have a bit of artwork than I can use to test with, then we can start there I suppose.

Offline erico

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 4306
    • View Profile
    • Portfolio
Re: INPUT magazine
« Reply #118 on: 2015-Oct-23 »
Yep, are you looking for static images or images like dungeon master?
Particularly, I prefer the maze block style of the later, specially hired guns for its z level.

Are the images supposed to run on a real coco? If so, and the style is dungeon based, then I´m quite found of the corridors of Major Istar and Escape 2012. Problem would be producing those images. What do you think?

Offline matchy

  • Prof. Inline
  • *****
  • Posts: 1544
    • View Profile
Re: INPUT magazine
« Reply #119 on: 2015-Oct-23 »
I don't imagine either of us manual working on like background art for 20 rooms. Hence, I don't think we will get far this way unlike the adventure game maker, where the rooms and data can be rendered not only for the coco but perhaps other systems also. Is it really worth the effort?