|
Post by aurel on Mar 18, 2023 13:24:22 GMT -6
i continue to code on space shooter why BORG..heh remaind me on SterTrek ;D it is not Borg qube than Borg sphere
|
|
|
Post by johnno56 on Mar 19, 2023 5:31:12 GMT -6
Borg spheres are generally smaller and move about quicker over shorter distances than the cubes...
|
|
|
Post by aurel on Mar 19, 2023 8:37:17 GMT -6
YES ...you know the Trek...because you are trekie
|
|
|
Post by aurel on Mar 19, 2023 9:44:25 GMT -6
i am trekie too but you are spock and i am quinto
|
|
|
Post by aurel on Apr 12, 2023 11:28:51 GMT -6
VERSION 10
This is some sort of breakthrough for me and for micro(A) interpreter. Event driven programming is in basic very simply once you get it how work and on Windows is crucial thing. So to short story i finally add event IDOK using WM_COMMAND message to enable testing IDOK constant which work by pressing key ENTER out of WM_KEYDOWN message ,so on this process i can get text from edit control for testing i just add print text "IDOK" on left side of window each time ENTER key is pressed which is important for some type of programs like quiz or textual based programs ..or similar
here is test program in micro(A) version 10.
'create input box ( edit control used for input text) ptr hbox ,hImg,hb ptr wmKeyDown, wmCommand str sText, cStr var wp, tx ,ty 'LoadImage(0, strRes, imgType, imgW, imgH, cFlag) LoadImg hImg,"microgirls.bmp" ,0, 264,236, 24 wcolor 200,190,200 : swap cStr = "test text" 'syntax INPUTBOX handle , x,y,w,h,text ShowImgT hImg,400,80,264,236 :swap INPUTBOX hbox , 10, 350, 300, 23 , "micro(A)" print 10,10,"Testing IDOK event under WM_COMMAND message in micro(A) v10" GETTEXT hbox , sText print 10,400, sText : swap ty = 50
'events................. WinMsg wmCOMMAND 'in this case hWparam is LoWord(wParam) -> control ID hWparam wp
'if is -> IDOK / which is 1 if wp = 1 tx = 10 : ty = ty + 20 print tx,ty,"IDOK" swap endif
EndWm '..................
func get_text() GETTEXT hbox, sText rect 10,400,100,23 fcolor 200,230,250 : print 10,400, sText : swap endfn
|
|
|
Post by aurel on May 5, 2023 11:46:42 GMT -6
GUESS THE NUMBER v3 in micro(A) This is v3 with some improved functionality ( and to show that is possible to make simple game in micro(A) )
|
|
|
Post by aurel on May 22, 2023 7:37:43 GMT -6
|
|
|
Post by n00b on May 22, 2023 20:01:39 GMT -6
Cool, I will grab this release for my test.
|
|
|
Post by aurel on May 23, 2023 6:07:28 GMT -6
All fine @n00b Sorry i update it again..i forget to enable IDCANCEL key button ..which is ESC to improve some programs in this case GuessMyNumber.bas just unzip and replace it with existing interpreter exe microA10.exe microA10.zip (25.66 KB)
|
|
|
Post by aurel on May 23, 2023 6:16:28 GMT -6
In case player(user) first go to input control and type something then he cannot start new game by pressing key N So if you do that , press key ESC which is IDCANCEL and which work even is cursor on input control..( input control have focus) and on this way you can start new game pressing key N. this part of code prevent this : 'ESC key 'IDCANCEL if wp = 2 newGame = 0 : SETTEXT hbox,"Press key N for new game" : setfocus 0 : setfocus hbox endif
|
|
|
Post by aurel on May 23, 2023 6:37:22 GMT -6
|
|
|
Post by aurel on May 23, 2023 13:56:16 GMT -6
Also i forget to add better chm file
so you can replace it with this one:
|
|
|
Post by aurel on Jun 4, 2023 9:10:34 GMT -6
This is quick video about how to use micro(A) ..with quirks Yes i also have some problems with Find/Replace in AurelEdit micro version.. n00b says about sprite limitation yes that is true ..for testing purpose it can handle only 8 sprites for now ,but i can increase this number ..i really rare do some sprite things and i am stupid for games video is not the best and my english is not good but i hope you can understand ..just increase volume
|
|
|
Post by aurel on Jun 4, 2023 9:54:29 GMT -6
n00b sprite test is really crazy to me at first not work for me but then i figured why back image ned to be swapped first: I must add it to arrays:
'sprite test by n00b ptr tileImg, spriteImg, box_img ptr xt, yt
ptr bkg_img, sprite_img, box_img, img2 LoadImg bkg_img , "bkg.bmp", 0, 640, 360, 24 LoadImg sprite_img , "img2.bmp", 0, 32, 32, 24
ShowImgT bkg_img, 0, 0, 640, 360 :swap
var x0, y0, xd0, yd0 var x1, y1, xd1, yd1 var x2, y2, xd2, yd2 var x3, y3, xd3, yd3 var x4, y4, xd4, yd4 var x5, y5, xd5, yd5 var x6, y6, xd6, yd6
ptr xedge, yedge xedge = 640 yedge = 360
xd0 = rand(4)+1 : yd0 = rand(4)+1 x0 = 1 : y0 = 1 xd1 = rand(4)+1 : yd1 = rand(4)+1 x1 = 1 : y1 = 1 xd2 = rand(4)+1 : yd2 = rand(4)+1 x2 = 1 : y2 = 1 xd3 = rand(4)+1 : yd3 = rand(4)+1 x3 = 1 : y3 = 1 xd4 = rand(4)+1 : yd4 = rand(4)+1 x4 = 1 : y4 = 1 xd5 = rand(4)+1 : yd5 = rand(4)+1 x5 = 1 : y5 = 1 xd6 = rand(4)+1 : yd6 = rand(4)+1 x6 = 1 : y6 = 1
var true true = 1
while true > 0 x0 = x0 + xd0 y0 = y0 + yd0 if x0 > 600 x0 = rand(100)+100 xd0 = -1 * xd0 endif if x0 < 0 x0 = rand(100)+100 xd0 = -1 * xd0 endif if y0 > 300 y0 = rand(100)+70 yd0 = -1 * yd0 endif if y0 < 50 y0 = rand(100)+70 yd0 = -1 * yd0 endif
x1 = x1 + xd1 y1 = y1 + yd1 if x1 > 600 x1 = rand(100)+100 xd1 = -1 * xd1 endif if x1 < 0 x1 = rand(100)+100 xd1 = -1 * xd1 endif if y1 > 300 y1 = rand(100)+70 yd1 = -1 * yd1 endif if y1 < 50 y1 = rand(100)+70 yd1 = -1 * yd1 endif
x2 = x2 + xd2 y2 = y2 + yd2 if x2 > 600 x2 = rand(100)+100 xd2 = -1 * xd2 endif if x2 < 0 x2 = rand(100)+100 xd2 = -1 * xd2 endif if y2 > 300 y2 = rand(100)+70 yd2 = -1 * yd2 endif if y2 < 50 y2 = rand(100)+70 yd2 = -1 * yd2 endif
x3 = x3 + xd3 y3 = y3 + yd3 if x3 > 600 x3 = rand(100)+100 xd3 = -1 * xd3 endif if x3 < 0 x3 = rand(100)+100 xd3 = -1 * xd3 endif if y3 > 300 y3 = rand(100)+70 yd3 = -1 * yd3 endif if y3 < 50 y3 = rand(100)+70 yd3 = -1 * yd3 endif
x4 = x4 + xd4 y4 = y4 + yd4 if x4 > 600 x4 = rand(100)+100 xd4 = -1 * xd4 endif if x4 < 0 x4 = rand(100)+100 xd4 = -1 * xd4 endif if y4 > 300 y4 = rand(100)+70 yd4 = -1 * yd4 endif if y4 < 50 y4 = rand(100)+70 yd4 = -1 * yd4 endif
x5 = x5 + xd5 y5 = y5 + yd5 if x5 > 600 x5 = rand(100)+100 xd5 = -1 * xd5 endif if x5 < 0 x5 = rand(100)+100 xd5 = -1 * xd5 endif if y5 > 300 y5 = rand(100)+70 yd5 = -1 * yd5 endif if y5 < 50 y5 = rand(100)+70 yd5 = -1 * yd5 endif
x6 = x6 + xd6 y6 = y6 + yd6 if x6 > 600 x6 = rand(100)+100 xd6 = -1 * xd6 endif if x6 < 0 x6 = rand(100)+100 xd6 = -1 * xd6 endif if y6 > 300 y6 = rand(100)+70 yd6 = -1 * yd6 endif if y6 < 50 y6 = rand(100)+70 yd6 = -1 * yd6 endif
ShowImgT bkg_img, 0, 0, 640, 360 ShowImgT sprite_img, x0, y0, 32, 32 ShowImgT sprite_img, x1, y1, 32, 32 ShowImgT sprite_img, x2, y2, 32, 32 ShowImgT sprite_img, x3, y3, 32, 32 ShowImgT sprite_img, x4, y4, 32, 32 ShowImgT sprite_img, x5, y5, 32, 32 ShowImgT sprite_img, x6, y6, 32, 32
swap
wend
|
|
|
Post by aurel on Jun 5, 2023 16:14:17 GMT -6
OK I update ShowImgT to handle arrays and result is here, and effect is good for such a simple token interpreter like micro(A) is . of course i must decrease number of sprites from 1024 to 200 because on my maximum number is really slow. here is a new code : 'sprite test 2 by Aurel/ origin by n00b ptr bkg, sprite var xedge, yedge, sprn,i ,run xedge=800 :yedge=600: sprn=200 var xdr[sprn], ydr[sprn], xpo[sprn], ypo[sprn], ypos[100]
LoadImg bkg , "bkg.bmp" , 0, 800, 600, 16 LoadImg sprite , "img2.bmp", 0, 32, 32, 16
ShowImgT bkg, 0, 0, 800, 600 ypos[1] = 100 ShowImgT sprite, 0, ypos[1], 32,32 :swap
run=1 'loop while run = 1 'update background ShowImgT bkg,0, 0, 800, 600
i=1 while i < sprn xpo[i] = xpo[i] + xdr[i] : ypo[i] = ypo[i] + ydr[i] if xpo[i] > xedge : xpo[i] = 0 : endif if xpo[i] < 0 : xpo[i] = (xedge-32) : endif if ypo[i] > yedge-32 : ypo[i] = 0 : endif if ypo[i] < 50 : ypo[i] = (yedge-32) : endif 'update sprite ShowImgT sprite, xpo[i], ypo[i] , 32 ,32 i = i + 1 wend 'update window swap i=rand(sprn) : xdr[i]=(rand(8)-4) : ydr[i]=(rand(8)-4)
wend
|
|