Search found 409 matches

by Mentat
Tue Jul 29, 2008 9:10 am
Forum: QBASIC and QB64 Questions & Answers
Topic: Need help - Strange tile problem
Replies: 36
Views: 44066

Mentat, you already gave a very good reason NOT to use the GOTO. You are spoiling that by adding trivial reasons, as UNTIL can be substituted - and this is what I have used for years - with a WHILE/WEND. Just let your first, convincing reason why not to use GOTOs in public stand as THE reason, sinc...
by Mentat
Tue Jul 29, 2008 7:03 am
Forum: QBASIC and QB64 Questions & Answers
Topic: Need help - Strange tile problem
Replies: 36
Views: 44066

Do/loop allows you to use "until." But the operation is close.
by Mentat
Sun Jul 27, 2008 2:38 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: Need help - Strange tile problem
Replies: 36
Views: 44066

Good job.

Next up, generating animations on the fly. :mrgreen:
by Mentat
Sun Jul 27, 2008 12:39 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: Need help - Strange tile problem
Replies: 36
Views: 44066

Ralph, it isn't just my personal opinion. You don't ever, ever teach programming with goto. If you were just sharing your own code about your own project with experienced members, then I wouldn't care. Why do I care? Because newer coders write longer and longer programs as they develop. Goto makes i...
by Mentat
Sun Jul 27, 2008 9:10 am
Forum: QBASIC and QB64 Questions & Answers
Topic: Need help - Strange tile problem
Replies: 36
Views: 44066

Ebbeh :shock:. Don't use GOTO. Why did they still keep that spaghetti machine from hell? Use proper loops.
by Mentat
Sat Jul 26, 2008 6:18 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: Need help - Strange tile problem
Replies: 36
Views: 44066

Yeah. Here's I would do the whole thing if it were my project. Except that I would draw my tiles and sprite in Paint, then BLOAD them. This code runs fast enough so you can redraw every frame, without flicker. It takes care of collision detection with water and the sides of the map. screenres 640, 4...
by Mentat
Sat Jul 26, 2008 4:38 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: Need help - Strange tile problem
Replies: 36
Views: 44066

Oh, and Qb'll fuss at you if you try to read write past it's allocated space (default is 10). You have to dim the map to the proper size.
by Mentat
Sat Jul 26, 2008 4:30 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: Need help - Strange tile problem
Replies: 36
Views: 44066

Alright, I'm pulling out the big guns. SCREEN 13 'graphics DIM grass(10, 10), path(10, 10), water(10, 10) dim tent(10, 10), scout(10, 10), scoutmask(10, 10) dim map(15, 30) 'initialize variables dim scoutX dim scouty dim clr dim x dim y dim key dim tile dim vx dim vy 'player coordinates scoutX = 5 s...
by Mentat
Sat Jul 26, 2008 2:28 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: Need help - Strange tile problem
Replies: 36
Views: 44066

Boundaries are simple. This is when the map comes into play: Look up the array for where you want to go, and if it's a permissive tile (path, land, etc.), then move otherwise don't. And file i/o is, well, simple for simple stuff. Like this: input "Enter file: ", fileName$ open fileName$ fo...
by Mentat
Sat Jul 26, 2008 6:10 am
Forum: QBASIC and QB64 Questions & Answers
Topic: Need help - Strange tile problem
Replies: 36
Views: 44066

Oh, so that's what the old scout is for. But if you're scrolling, you would still have to update the screen.

So what do you want to do next? Save and load tiles/sprites from files? It's not hard, pretty much like READ. Except that it doesn't fill your program like DATA.
by Mentat
Fri Jul 25, 2008 9:12 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: Need help - Strange tile problem
Replies: 36
Views: 44066

Oh, I think it's for optimization (no point in refreshing a static screen). And for the water problem, I did a little fiddling, and the program was reading from the variable tileNumber (not the label), which didn't change because the last data statement is 3 (water). The program should read from the...
by Mentat
Fri Jul 25, 2008 6:52 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: Need help - Strange tile problem
Replies: 36
Views: 44066

What's the old scout for?
by Mentat
Thu Jul 24, 2008 4:57 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: Problem with billinear filtering with fixed point math
Replies: 3
Views: 11845

Hm. Are you using any bitwise calculations or manipulation?
by Mentat
Tue Jul 22, 2008 7:51 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: Help with masking and code layout. Please and thanks.
Replies: 28
Views: 34393

Got it to work. I had to cheat a little, since -lang QB is more FBish with it's graphics and was giving me trouble with page flipping. So I used screenLock and screenUnlock. A couple things to keep in mind: -Draw sprites after tiles, otherwise the tile will be over the sprite -Indentations help make...
by Mentat
Tue Jul 22, 2008 7:14 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: Problem with billinear filtering with fixed point math
Replies: 3
Views: 11845

Maybe MOD overflow backwards. Happened to me, and I got a cool fractal.
by Mentat
Tue Jul 22, 2008 6:31 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: Help with masking and code layout. Please and thanks.
Replies: 28
Views: 34393

burger2227 wrote:Have fun!

Ted
I think I'm going through pointer withdraw. I'll take any ptr.

Still working on the code. I don't know what I did, but it stopped putting water over everything.
by Mentat
Tue Jul 22, 2008 3:23 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: Help with masking and code layout. Please and thanks.
Replies: 28
Views: 34393

Alright, so you have: 'do stuff with an x FOR i% = 1 TO 25 READ p% 'blah blah blah NEXT i% 'do stuff with an O FOR i% = 1 TO 25 READ p% 'blah blah blah NEXT i% 'an x DATA 1, 0, 0, 0, 1 DATA 0, 1, 0, 1, 0 DATA 0, 0, 1, 0, 0 DATA 0, 1, 0, 1, 0 DATA 1, 0, 0, 0, 1 'an o DATA 0, 1, 1, 1, 0 DATA 1, 0, 0, ...
by Mentat
Tue Jul 22, 2008 11:39 am
Forum: QBASIC and QB64 Questions & Answers
Topic: Help with masking and code layout. Please and thanks.
Replies: 28
Views: 34393

Keep READ. Restore just goes back (or forward if you want).
by Mentat
Tue Jul 22, 2008 11:35 am
Forum: QBASIC and QB64 Questions & Answers
Topic: Help with masking and code layout. Please and thanks.
Replies: 28
Views: 34393

With "RESTORE". It's used like GOTO, but with data.
by Mentat
Tue Jul 22, 2008 11:07 am
Forum: QBASIC and QB64 Questions & Answers
Topic: Help with masking and code layout. Please and thanks.
Replies: 28
Views: 34393

Out of data means you're asking to read a data statement, but you've gone through all of them.