Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - STxAxTIC

Pages: 1 ... 71 72 [73]
1081
Programs / Re: QB64-interpreter
« on: July 27, 2017, 09:16:35 am »
Lovely, just lovely. This will be a great toy to play with. While it's still early, I'd like to hear your arguments for or against the idea of separating mechanism from interface, such that the (for lack of a better term) "logic unit" can be decoupled from screen drawing, for example. This way, you can install the brain into different places - chatbots, a scripting option within inform, etc.

1082
Programs / Re: Sample Of a Quitbox
« on: July 26, 2017, 09:01:03 am »
Howdy,

I like it. I was pleasantly surprised to type HELP and see that the mouse was enabled - that's not always obvious in screen 0 programs. I've always liked the screen 0 gui because it has that automatic "snap to grid" feeling about it.

If you hadn't noticed yet, it looks like one cannot drag the window all the way to the right; there is a one-character-wide gap left over.

Cant wait to see what you're using this for!

1083
QB64 Discussion / Re: Hi folks...
« on: July 25, 2017, 02:49:13 pm »
Hello Unseen, nice to un-see... you on these forums! (SMF = Simple "machine" forums if you want a pun with double cheese.)

Anyway, I am long aware of the points you raise both here and over at *.net. The question is: why won't people use pre-made tools, made specifically *for* their purposes, in favor of rolling their own shitty version that will never be finished? There are a few answers to this that I know of, and I won't dare try to spell them out. Half of the reasons are deeply Freudian. Let me instead zoom right into solution-think.

Speaking from the heart of the peanut gallery, our collective advice to you is to shove the work down our throats. Bulldog it a little more. If we run into trouble, we want you to be *right* there to hold hands. This isn't just the pipe dream of the novice - even the experts want support. (Demanding, I know.) One weird issue is  many people feel their questions are too stupid to post publicly on the forums - concerning enough for Odin to *almost* allow for anonymous posting on this site.

Another side point to hit on is website format. [abandoned, outdated and now likely malicious qb64 dot net website - don’t go there] had none, zip, zero. There was essentially no way to keep a project alive beyond bumping it on the forums. A catch-22, because a perfect program speaks for itself, does not need comments, and is then forgotten entirely. The old *.net forums are PACKed with solutions to various things, and today's wave of hobbyists is completely unaware of just how recently their same wheel had been invented. (I don't want to see collision detection discussed any more as an unsolved issue, ever.) Qb64.org solves the problem in spades. What we (mostly Odin) plan to do is showcase various projects front-and-center on the *.org homepage, and if that doesn't flag down enough attention, maybe a special spot on the front of the Forums page as well.

Of all the long-term QB64 projects out there, I can hardly name anyone beyond Fellippe whose projects belong on the front page. That is, besides you. GDK should be ignored no longer if given proper publicity. Speaking of that, do you have a website for your projects? Any indicator that convinces people that the project is alive and well is a plus.

Final note: The #qb64 IRC channel is a place where tons of light-hearted horseplay takes place. Come spend the rest of your live with us!

1084
Programs / Re: The Recursive Descent Parser
« on: July 24, 2017, 04:06:12 pm »
Hey eoredson,

I've always liked this project. I'm glad you still occasionally make noise about it! Just curious - is there any formal website or home for this? Does the project *.zip contain all documentation?

And a really off-the-wall question is, just how much of the code is from the underscore-ridden QB64 era, vs how much is mostly QB45 compatible?

(I could dig a bit and answer all this myself, but I figure the public questions make things easier.)

Thanks!

1085
Programs / Re: The Mystery of Robot Planet :)
« on: July 24, 2017, 03:52:39 pm »
Welcome aboard, roadbloc. Glad to see you found us here. It's been a little while since I've given your (latest) game a go (not counting a few years back.) If my darn office would calm down I could boot up QB64 without turning too many heads.

(Who am I kidding? I turn heads anyways.)

1086
QB64 Discussion / Re: Compound assignments
« on: July 23, 2017, 07:50:46 am »
I never been a fan of any of the ++ or -- notation, especially when the language lets you put the symbols on either side of the variable. What is so special about "1" anyway? Why don't we have +++ and --- to skip along by 2?

I have always thought that += and -= were pretty nice though, its just that QB64 doesn't need them. There are a handful of deep reasons that I won't rant about, so the cop-out explanation is: Seeing how anything that breaks QB45 compatibility would need an underscore by tradition, I don't think that _+= and _-= are visually appealing. Of course I'm half joking, but not the other half. I'm at least 51% confident that those with the proper chops to do so won't be adding any exotic assignment operators to QB64 at the end of the day.

Come to think of it, according to certain opinions that I think are correct, using the equal sign as an assignment operator is a design mistake repeated hundreds of times since its first instance. The next good language won't overload the = symbol.

1087
Programs / Re: Brainfuck Interpreter
« on: July 23, 2017, 07:40:37 am »
Thanks for keeping us posted bplus. I was going to respond over at the "other" forum but didn't because... reasons... namely all of my posts need to be approved first. Still waiting for a few posts (from days ago) to make it past the admin over there. No telling what a PG-13 site would do with a title like BrainFuck. Ya know, the same place that throws me ads for mail-in Thai brides. Very child-friendly as a concept.

1088
QB64 Discussion / Re: Burning ship explorer
« on: July 22, 2017, 04:07:47 am »
Beautiful. This deserves an entry at https://qb64.org/samples/. Let's hope that Odin gets around to it.

1089
Hiya Aureal,

I had to double-take your name cause there is a guy around going by "Aurel". Anyway, welcome aboard and nice program. A handful of folks work on similar things, some right this minute for all I know. Keybone works in a very similar direction in particular.

If you can bear to integrate IRC into your culture, we hang out a #qb64 on freenode.
Use http://www.qb64.org/ircpage.html for starters if you don't have a client.

Anyway, keep up the good work and keep us in the LOOP (no pun, but yes pun).

1090
QB64 Discussion / Re: Car : Physics Test
« on: July 16, 2017, 01:01:29 am »
Nice catch Ashish - Yeah, I was going a little too fast when looking for the variable that contained 1/.077=13. Your new correction is probably the better form.

1091
QB64 Discussion / Re: Car : Physics Test
« on: July 15, 2017, 11:11:25 am »
Hello Ashish -

I like it. Thanks for posting! I noticed that maaaaybe the wheels have a little slip to them, and at low speeds below .8 they do some funny things. I see why you did that on purpose - no worries.

If (and for the moment, only if) the "noise" of the road is not *too* steep and crazy - kindof like the settings you are demonstrating, I might suggest calculating the rotation angle of each wheel not with velocity, but with position. I modified the code for the front wheel only to demonstrate this - you can see that it doesn't want to slip like that back one does.

To generalize the method for all kinds of curves that go upside down and stuff, that can be done too.

Anyway, compare the front and back wheels:

Code: QB64: [Select]
  1. '####################
  2. ' Cars By Ashish
  3. '####################
  4. ' Just for fun! :)
  5. '@KingOfCoders
  6.  
  7. _TITLE "Cars"
  8.  
  9. TYPE vec2
  10.     x AS SINGLE
  11.     y AS SINGLE
  12.  
  13. TYPE wheels
  14.     pos AS vec2 'position
  15.     vel AS vec2 'velocity
  16.     acc AS vec2 'acceleration
  17.     ang AS _FLOAT 'angle
  18.     radius AS SINGLE 'wheel radius
  19.     pos2 AS vec2
  20.  
  21. TYPE headlights
  22.     pos AS vec2
  23.     switched AS _BYTE
  24.     'power as single
  25.  
  26. TYPE bodyFrames
  27.     baseFrame AS vec2
  28.     steepFrame AS vec2
  29.     baseFrame2 AS vec2
  30.     steepFrame2 AS vec2
  31.  
  32. TYPE cars
  33.     backWheel AS wheels
  34.     frontWheel AS wheels
  35.     headlight AS headlights
  36.     body AS bodyFrames
  37.  
  38.  
  39. SCREEN _NEWIMAGE(800, 400, 32)
  40.  
  41. 'noise function related variables
  42. DIM SHARED perlin_octaves AS SINGLE, perlin_amp_falloff AS SINGLE
  43.  
  44. DIM SHARED Car AS cars, white&, roadMap(800) AS vec2
  45.  
  46. FOR i = 0 TO 800
  47.     roadMap(i).x = i
  48.     roadMap(i).y = noise(xoff, yoff, 0) * 40 + 363
  49.     xoff = xoff + .001
  50.     yoff = yoff + .01
  51.  
  52. white& = _RGB(255, 255, 255)
  53. v = RND
  54. Car.backWheel.pos.x = 50
  55. Car.backWheel.pos.y = 350
  56. Car.backWheel.ang = v
  57. Car.backWheel.radius = 13
  58.  
  59. Car.frontWheel.pos.x = 130
  60. Car.frontWheel.pos.y = 350
  61. Car.frontWheel.ang = v
  62. Car.frontWheel.radius = 13
  63.  
  64. Car.headlight.switched = -1
  65.  
  66. initCar Car
  67.  
  68.  
  69.     drawCar Car
  70.     drawMap roadMap()
  71.     IF _KEYDOWN(ASC("d")) THEN
  72.         Car.backWheel.acc.x = Car.backWheel.acc.x + .05
  73.         Car.frontWheel.acc.x = Car.frontWheel.acc.x + .05
  74.     END IF
  75.     IF _KEYDOWN(ASC("a")) THEN
  76.         Car.backWheel.acc.x = Car.backWheel.acc.x - .05
  77.         Car.frontWheel.acc.x = Car.frontWheel.acc.x - .05
  78.     END IF
  79.     IF _KEYDOWN(ASC(" ")) THEN
  80.         IF Car.backWheel.vel.x > 0 THEN Car.backWheel.vel.x = Car.backWheel.vel.x - .09
  81.         IF Car.backWheel.vel.x < 0 THEN Car.backWheel.vel.x = Car.backWheel.vel.x + .09
  82.  
  83.         IF Car.frontWheel.vel.x > 0 THEN Car.frontWheel.vel.x = Car.frontWheel.vel.x - .09
  84.         IF Car.frontWheel.vel.x < 0 THEN Car.frontWheel.vel.x = Car.frontWheel.vel.x + .09
  85.     END IF
  86.     IF _KEYDOWN(ASC("h")) THEN
  87.         IF Car.headlight.switched THEN Car.headlight.switched = 0 ELSE Car.headlight.switched = -1
  88.     END IF
  89.     updateCar Car
  90.     _LIMIT 40
  91.     _DISPLAY
  92.     CLS , 1
  93.     Car.backWheel.acc.x = 0
  94.     Car.frontWheel.acc.x = 0
  95.  
  96.     IF Car.frontWheel.pos.x < 800 AND Car.backWheel.pos.x > 0 THEN
  97.         Car.backWheel.pos.x = roadMap(Car.backWheel.pos2.x).x
  98.         Car.backWheel.pos.y = roadMap(Car.backWheel.pos2.x).y - 13
  99.  
  100.         Car.frontWheel.pos.x = roadMap(Car.frontWheel.pos2.x).x
  101.         Car.frontWheel.pos.y = roadMap(Car.frontWheel.pos2.x).y - 13
  102.     END IF
  103.  
  104. SUB drawMap (mapData() AS vec2)
  105. FOR i = 0 TO UBOUND(mapData) - 1
  106.     LINE (mapData(i).x, mapData(i).y)-(mapData(i + 1).x, mapData(i + 1).y), white&
  107.  
  108. SUB initCar (obj AS cars)
  109. obj.headlight.pos.x = obj.frontWheel.pos.x + 25
  110. obj.headlight.pos.y = obj.frontWheel.pos.y - 25
  111.  
  112. SUB drawCar (obj AS cars)
  113. 'we will draw body frames first, then, lights, followed by wheels.
  114.  
  115. LINE (obj.backWheel.pos.x - 30, obj.backWheel.pos.y - 40)-(obj.frontWheel.pos.x + 25, obj.frontWheel.pos.y - 40), white& 'up base
  116. LINE (obj.backWheel.pos.x + obj.backWheel.radius, obj.backWheel.pos.y)-(obj.frontWheel.pos.x - obj.frontWheel.radius, obj.frontWheel.pos.y), white& 'down base
  117.  
  118. '.....and some more..... little lines to cover down base.....
  119. LINE (obj.backWheel.pos.x - obj.backWheel.radius, obj.backWheel.pos.y)-(obj.backWheel.pos.x - 30, obj.backWheel.pos.y), white&
  120. LINE (obj.frontWheel.pos.x + obj.backWheel.radius, obj.frontWheel.pos.y)-(obj.frontWheel.pos.x + 25, obj.frontWheel.pos.y), white&
  121.  
  122. 'left & right of base
  123. LINE (obj.backWheel.pos.x - 30, obj.backWheel.pos.y)-(obj.backWheel.pos.x - 30, obj.backWheel.pos.y - 40), white&
  124. LINE (obj.frontWheel.pos.x + 25, obj.frontWheel.pos.y)-(obj.frontWheel.pos.x + 25, obj.frontWheel.pos.y - 40), white&
  125.  
  126. 'steeps
  127.  
  128. LINE (obj.backWheel.pos.x - 30, obj.backWheel.pos.y - 40)-(obj.backWheel.pos.x + 5, obj.backWheel.pos.y - 70), white&
  129. LINE (obj.frontWheel.pos.x + 25, obj.frontWheel.pos.y - 40)-(obj.frontWheel.pos.x - 5, obj.frontWheel.pos.y - 70), white&
  130.  
  131. 'roof
  132. LINE (obj.backWheel.pos.x + 5, obj.backWheel.pos.y - 70)-(obj.frontWheel.pos.x - 5, obj.frontWheel.pos.y - 70), white&
  133.  
  134. 'divider, to form window glasses
  135. 'line (obj.backWheel.pos.y - 70)-(obj.)
  136.  
  137. 'lights, x = cos0*r + xx, cos0 = x - xx / r
  138. IF obj.headlight.switched THEN
  139.     FOR i = 1 TO 150
  140.         h = map(i, 1, 150, 3, 30)
  141.         a = map(i, 1, 100, 200, 0)
  142.         LINE (obj.headlight.pos.x + i, obj.headlight.pos.y - h)-(obj.headlight.pos.x + i, obj.headlight.pos.y + h), _RGBA(255, 255, 255, a)
  143.     NEXT
  144. 'tyres
  145. CIRCLE (obj.backWheel.pos.x, obj.backWheel.pos.y), obj.backWheel.radius, white&
  146. CIRCLE (obj.frontWheel.pos.x, obj.frontWheel.pos.y), obj.frontWheel.radius, white&
  147.  
  148. LINE (COS(obj.backWheel.ang) * obj.backWheel.radius + obj.backWheel.pos.x, SIN(obj.backWheel.ang) * obj.backWheel.radius + obj.backWheel.pos.y)-(COS(obj.backWheel.ang + _PI) * obj.backWheel.radius + obj.backWheel.pos.x, SIN(obj.backWheel.ang + _PI) * obj.backWheel.radius + obj.backWheel.pos.y), white&
  149. LINE (COS(obj.frontWheel.ang) * obj.frontWheel.radius + obj.frontWheel.pos.x, SIN(obj.frontWheel.ang) * obj.frontWheel.radius + obj.frontWheel.pos.y)-(COS(obj.frontWheel.ang + _PI) * obj.frontWheel.radius + obj.frontWheel.pos.x, SIN(obj.frontWheel.ang + _PI) * obj.frontWheel.radius + obj.frontWheel.pos.y), white&
  150.  
  151.  
  152.  
  153. SUB updateCar (obj AS cars)
  154. obj.backWheel.pos.x = obj.backWheel.pos.x + obj.backWheel.vel.x
  155. obj.backWheel.pos.y = obj.backWheel.pos.y + obj.backWheel.vel.y
  156.  
  157. IF obj.backWheel.vel.x > 0 THEN obj.backWheel.vel.x = obj.backWheel.vel.x - .01
  158. IF obj.backWheel.vel.x < 0 THEN obj.backWheel.vel.x = obj.backWheel.vel.x + .01
  159.  
  160. obj.frontWheel.pos.x = obj.frontWheel.pos.x + obj.frontWheel.vel.x
  161. obj.frontWheel.pos.y = obj.frontWheel.pos.y + obj.frontWheel.vel.y
  162.  
  163. IF obj.frontWheel.vel.x > 0 THEN obj.frontWheel.vel.x = obj.frontWheel.vel.x - .01
  164. IF obj.frontWheel.vel.x < 0 THEN obj.frontWheel.vel.x = obj.frontWheel.vel.x + .01
  165.  
  166. obj.backWheel.vel.x = obj.backWheel.vel.x + obj.backWheel.acc.x
  167. obj.backWheel.vel.y = obj.backWheel.vel.y + obj.backWheel.acc.y
  168.  
  169. obj.frontWheel.vel.x = obj.frontWheel.vel.x + obj.frontWheel.acc.x
  170. obj.frontWheel.vel.y = obj.frontWheel.vel.y + obj.frontWheel.acc.y
  171.  
  172. IF ABS(obj.backWheel.vel.x) > .8 THEN
  173.     IF obj.backWheel.vel.x <> 0 THEN obj.backWheel.ang = obj.backWheel.ang + obj.backWheel.vel.x * 0.077
  174.  
  175. IF ABS(obj.frontWheel.vel.x) > 0 THEN
  176.     IF obj.frontWheel.vel.x <> 0 THEN obj.frontWheel.ang = obj.frontWheel.pos.x / Car.frontWheel.radius
  177. obj.headlight.pos.x = obj.frontWheel.pos.x + 25
  178. obj.headlight.pos.y = obj.frontWheel.pos.y - 25
  179.  
  180. obj.backWheel.pos2.x = INT(obj.backWheel.pos.x)
  181. obj.backWheel.pos2.y = INT(obj.backWheel.pos.y)
  182.  
  183. obj.frontWheel.pos2.x = INT(obj.frontWheel.pos.x)
  184. obj.frontWheel.pos2.y = INT(obj.frontWheel.pos.y)
  185.  
  186. FUNCTION map! (value!, minRange!, maxRange!, newMinRange!, newMaxRange!)
  187. map! = ((value! - minRange!) / (maxRange! - minRange!)) * (newMaxRange! - newMinRange!) + newMinRange!
  188.  
  189. FUNCTION dist! (x1!, y1!, x2!, y2!)
  190. dist! = SQR((x2! - x1!) ^ 2 + (y2! - y1!) ^ 2)
  191.  
  192. FUNCTION noise! (x AS SINGLE, y AS SINGLE, z AS SINGLE)
  193. STATIC p5NoiseSetup AS _BYTE
  194. STATIC perlin() AS SINGLE
  195. STATIC PERLIN_YWRAPB AS SINGLE, PERLIN_YWRAP AS SINGLE
  196. STATIC PERLIN_ZWRAPB AS SINGLE, PERLIN_ZWRAP AS SINGLE
  197. STATIC PERLIN_SIZE AS SINGLE
  198.  
  199. IF NOT p5NoiseSetup THEN
  200.     p5NoiseSetup = -1
  201.  
  202.     PERLIN_YWRAPB = 4
  203.     PERLIN_YWRAP = INT(1 * (2 ^ PERLIN_YWRAPB))
  204.     PERLIN_ZWRAPB = 8
  205.     PERLIN_ZWRAP = INT(1 * (2 ^ PERLIN_ZWRAPB))
  206.     PERLIN_SIZE = 4095
  207.  
  208.     perlin_octaves = 4
  209.     perlin_amp_falloff = 0.5
  210.  
  211.     REDIM perlin(PERLIN_SIZE + 1) AS SINGLE
  212.     DIM i AS SINGLE
  213.     FOR i = 0 TO PERLIN_SIZE + 1
  214.         perlin(i) = RND
  215.     NEXT
  216.  
  217. x = ABS(x)
  218. y = ABS(y)
  219. z = ABS(z)
  220.  
  221. xi = INT(x)
  222. yi = INT(y)
  223. zi = INT(z)
  224.  
  225. xf = x - xi
  226. yf = y - yi
  227. zf = z - zi
  228.  
  229. r = 0
  230. ampl = .5
  231.  
  232. FOR o = 1 TO perlin_octaves
  233.     DIM of AS SINGLE, rxf AS SINGLE
  234.     DIM ryf AS SINGLE, n1 AS SINGLE, n2 AS SINGLE, n3 AS SINGLE
  235.     of = xi + INT(yi * (2 ^ PERLIN_YWRAPB)) + INT(zi * (2 ^ PERLIN_ZWRAPB))
  236.  
  237.     rxf = 0.5 * (1.0 - COS(xf * _PI))
  238.     ryf = 0.5 * (1.0 - COS(yf * _PI))
  239.  
  240.     n1 = perlin(of AND PERLIN_SIZE)
  241.     n1 = n1 + rxf * (perlin((of + 1) AND PERLIN_SIZE) - n1)
  242.     n2 = perlin((of + PERLIN_YWRAP) AND PERLIN_SIZE)
  243.     n2 = n2 + rxf * (perlin((of + PERLIN_YWRAP + 1) AND PERLIN_SIZE) - n2)
  244.     n1 = n1 + ryf * (n2 - n1)
  245.  
  246.     of = of + PERLIN_ZWRAP
  247.     n2 = perlin(of AND PERLIN_SIZE)
  248.     n2 = n2 + rxf * (perlin((of + 1) AND PERLIN_SIZE) - n2)
  249.     n3 = perlin((of + PERLIN_YWRAP) AND PERLIN_SIZE)
  250.     n3 = n3 + rxf * (perlin((of + PERLIN_YWRAP + 1) AND PERLIN_SIZE) - n3)
  251.     n2 = n2 + ryf * (n3 - n2)
  252.  
  253.     n1 = n1 + (0.5 * (1.0 - COS(zf * _PI))) * (n2 - n1)
  254.  
  255.     r = r + n1 * ampl
  256.     ampl = ampl * perlin_amp_falloff
  257.     xi = INT(xi * (2 ^ 1))
  258.     xf = xf * 2
  259.     yi = INT(yi * (2 ^ 1))
  260.     yf = yf * 2
  261.     zi = INT(zi * (2 ^ 1))
  262.     zf = zf * 2
  263.  
  264.     IF xf >= 1.0 THEN xi = xi + 1: xf = xf - 1
  265.     IF yf >= 1.0 THEN yi = yi + 1: yf = yf - 1
  266.     IF zf >= 1.0 THEN zi = zi + 1: zf = zf - 1
  267. noise! = r
  268.  
  269. SUB noiseDetail (lod!, falloff!)
  270. IF lod! > 0 THEN perlin_octaves = lod!
  271. IF falloff! > 0 THEN perlin_amp_falloff = falloff!
  272.  

Pages: 1 ... 71 72 [73]