Veditor (for Vector Code)
I made a custom text editor for my coding project Vector Code!!!
Go visit Vector Code on my page for more info!!
Press ` and O to open and ` and S to save!
DOCUMENTATION:
THIS line must be at the start of every .vc file to verify \/
VC PROGRAM FILE 753753753
// this is a comment!
--------------examplefile.vc-------------
VC PROGRAM FILE 753753753
// recommended settings:
res==3
fps==20
mov==3
x==1
y==1
block rest {
kp key,r
if key
reset
]
block movem [
kp key,w
if key
y=+1
kp key,s
if key
y=-1
kp key,a
if key
x=-1
kp key,d
if key
x=+1
]
block loop [
r==x
r=*10
col c,r,0,0
erase
draw x,y,c
col c2,mx,my,0
draw mx,my,c2
dbg x
do movem
break
// break allows screen to refresh naturall
do loop
// do loop now makes this run forever
]
do loop
// initiate loop block
-------end of file------------------
Here's a breakdown:
// this is a comment.
VARIABLES:
v==2 : sets the variable v to 2
v=+2 : sets v to v+2
v=-2 : sets v to v-2
v=*2 and v=/2 do the same.
you may use variable names in many places like drawing or colors etc.
and v==g sets the var v to the var g.
NECESSARY VARIABLES:
res : needed to set the resolution of the screen, smaller means more precise, my suggestion is 3.
fps : controls how fast the script runs!
PRESET VARS:
mx and my give the mouse x and mouse y.
OPERATOR FUNCTION:
"oper v,n>2" will check if n is larger than 2, v will equal 1, if it's not larger than 2 v will be 0.
There is <, >, <=, >=
SINE / COS :
This is good for circles,
"sine n,1,10,v" will set v to sin(n*1)*10, or basically you can make a circle, I need to understand this better myself so just play around with it,
By the way there's also a COS, so "cos n,1,10,v" works almost the same.
RAND:
"rand var,min,max,decimals" sets var to a random number between min and max, and you can say 1 decimal, or 2 decimals.
DIST:
"dist x1,y1,x2,y2,var" will set var to the distance between the 2 coordinates.
DRAWING:
"draw x,y,color" draws a point at x and y with the color of choice, which is a hex code so you may predefine them early on, this looks like:
black==#000000
white==#ffffff
red==#ff0000
and so on.
KEY PRESSES:
"kp key,a" checks if a is pressed, if it is, key equals 1, if it doesn't, key is set to 0.
IF STATEMENT:
"if" will choose whether or not to skip the next line,
so "if 1" runs the next line
"if 0" skips the next line.
"if v
g==2" will set g to 2 if v equals 1, otherwise g is left alone.
(A good use for this is:
"kp key,a
if key
dbg #a pressed")
BLOCKS (/ functions):
"block setA [
a==5
]"
This creates a function, similar to python "def", you may call it with "do setA"
"block (name) [
]"
and "do (name)"
COLOR MANIPULATION:
"col var,r,g,b" sets var to a hex code of each rgb variable from 1-255.
"col color,10,10,10" would set "color" to "#0A0A0A"
Useful for dynamic colors!
SIMPLE MOVEMENT BASICS:
There are multiple ways to do movement,
I think the most common is:
"kp key,w
if key
y=+1"
but you may also
"kp key,w
y=+key"
DBG:
"dbg (text)" just displays text on the screen, I'm going to make it have x and y stuff eventually.
"dbg x" would print the variable x, usually for debugging.
EXTRA:
"break" is the function that lets the screen update naturally, put it at the end of your main loop script. You may use it more.
"erase" clears the screen.
"reset" resets the engine to allow for other file uploading, may make some changes on that.
I recommend adding these lines to your main loop script:
"kp key,r
if key
reset"
/////////////// end of Documentation! ////////////
| Published | 11 days ago |
| Status | In development |
| Category | Tool |
| Platforms | HTML5 |
| Author | This Dude |
| Content | No generative AI was used |
Leave a comment
Log in with itch.io to leave a comment.