Scrolling engine

Announce and discuss the progress of your various programming-related projects...programs, games, websites, tutorials, libraries...anything!

Moderators: Pete, Mods

User avatar
Codemss
Veteran
Posts: 124
Joined: Sun Jun 24, 2007 6:49 am
Location: Utrecht, The Netherlands
Contact:

Scrolling engine

Post by Codemss » Sat Dec 08, 2007 4:21 pm

This is about a map scrolling engine that I've thought of while writing an article for QBE. I first doubted if it was fast enough, but I'm very enthousast now, because it runs at 100 fps(compiled of course) on a good computer.
The engine doen't look good, but look beneath that and look at the possibilities. I will add a texture soon and a landscape instead of just black and blue dots.

Here is my monchronome map scroller. I doesn't work with tiles, but with 2 colour pixels. This example may suck because I haven't made a map editor yet. Probably I will make one soon in screen 12. Anyway, it is scrolling a map that is 8 times larger then the screen. The pixels are just random and that looks shitty, but imagine how nice it could be if the pixels are placed in some kind of landscape.

This engine can be used with tiles also, so that you can see only the coloured pixels on the map, so textures actually are supported.

I think I will release a demo soon that uses this with a texture and with a landscape. But I first have to make the map editor.

This may going to be used in a worms-like engine. I wrote an article on that(in the QBE that is not out yet), where this technique is described. I did some optimization though.
Well, I'll give you the code:
<Look>

Code: Select all

REM Scroll.bas
REM ______________________________
REM Testcase for monochrome engine
REM Can scroll a map with monchronome pixels
REM The map can be up to 8 times the screen
REM But only supports two color(back and foreground)
REM Made by Codemss
REM
REM May be used for learning purposes
REM But if you copy ANY of this code
REM I want credit
REM 
REM Greets,
REM Codemss
REM ______________________________
REM BTW
REM I wrote a article about this for the QBE
REM (QBasic Express), but it has not yet came out
REM
REM I will send a new version with this code included to Pete
REM I am very happy because in the article I doubted if it was
REM possible to use this technique at high speed
REM but I got 100 fps on a pentium 4.
REM So I think it is fast enough
REM ______________________________

DECLARE SUB drawrow (x%, y%)
DECLARE FUNCTION getpix% (x%, y%)
CLS
SCREEN 13
DEFINT A-Z
REM $DYNAMIC

REM IMPORTANT: IF YOU WANT TO COMPILE, MAKE THESE INTEGERS!!
REM THIS IS FASTER AND ELSE IT PROBABLY WONT WORK
REM DO NOT MAKE THE WHOLE LINE A COMMENT AS THE VARIABLES
REM STILL NEED TO BE SHARED!

DIM SHARED p AS LONG
DIM SHARED offset AS LONG
DIM SHARED mul320(319) AS LONG

CONST xsize = 320 * 8 - 1

DIM SHARED buf(31999), bufseg
bufseg = VARSEG(buf(0))

DIM SHARED ntb(255, 7)
FOR n = 0 TO 255
  FOR b = 0 TO 7
    IF (n AND (2 ^ b)) THEN ntb(n, b) = 1
  NEXT
NEXT

DIM SHARED lut(319)

DIM SHARED bitnum(xsize)
DIM SHARED bytenum(xsize)
FOR x = 0 TO xsize
  bitnum(x) = x AND 7
  bytenum(x) = x \ 8
NEXT

FOR y = 0 TO 319
  mul320(y) = 320& * y
NEXT

DEF SEG = bufseg
FOR y = 0 TO 199
  FOR x = 0 TO 319
    POKE p, INT(RND * 256)
    p = p + 1
  NEXT
NEXT

t1! = TIMER
DO UNTIL LEN(INKEY$)
  p = 0
  FOR y = 0 TO 199
    drawrow a, y
  NEXT
  a = a + 1
  IF a > xsize - 319 THEN EXIT DO
LOOP
t2! = TIMER
PRINT a / (t2! - t1!)
DEF SEG
SLEEP

REM $STATIC
SUB drawrow (x, y)
offset = bytenum(x) + mul320(y)
bit = bitnum(x)
xx = 0
DO
  value = PEEK(offset)
  FOR b = bit TO 7
    lut(xx) = ntb(value, b)
    IF xx = 319 THEN EXIT DO
    xx = xx + 1
  NEXT
  bit = 0
  offset = offset + 1
LOOP
DEF SEG = &HA000
FOR xx = 0 TO 319
  POKE p, lut(xx)
  p = p + 1
NEXT
DEF SEG = bufseg
END SUB
Last edited by Codemss on Sun Dec 09, 2007 5:45 am, edited 1 time in total.
Check out my site: <a href="http://members.lycos.nl/rubynl">Click here</a>
Hope you like it. Send some feedback if you want: <a href="mailto:basicallybest@live.nl">Mail me</a>
Codemss, before known as RubyNL

User avatar
coma8coma1
Veteran
Posts: 100
Joined: Sat Dec 08, 2007 5:29 pm
Location: Maryland, USA
Contact:

Post by coma8coma1 » Sat Dec 08, 2007 7:13 pm

beautiful. runs really smooth for me. makes me think of NES games, the way the scrolled at just the right speed to give the illusion of fluid motion (as opposed to jerky redraw)

i dig it

User avatar
burger2227
Veteran
Posts: 2409
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

CREDIT?

Post by burger2227 » Thu Dec 13, 2007 2:45 pm

What ever happened to the graphics text stuff Ildurest and I showed you?

Did we ever get credit or did you just toss it out?

Ted
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0

User avatar
Codemss
Veteran
Posts: 124
Joined: Sun Jun 24, 2007 6:49 am
Location: Utrecht, The Netherlands
Contact:

Re: CREDIT?

Post by Codemss » Fri Dec 14, 2007 5:29 pm

burger2227 wrote:What ever happened to the graphics text stuff Ildurest and I showed you?
What graphics text stuff. Sorry but I really don't know where you are talking about. Can you tell me or send me a link to that?
Check out my site: <a href="http://members.lycos.nl/rubynl">Click here</a>
Hope you like it. Send some feedback if you want: <a href="mailto:basicallybest@live.nl">Mail me</a>
Codemss, before known as RubyNL

User avatar
burger2227
Veteran
Posts: 2409
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Post by burger2227 » Wed Dec 19, 2007 3:17 am

How soon you forget............

And you take credit for code that somebody else helped make!

RUBY NL will always play that game and let everybody think he is a master coder.

Actually you sit back like that avitar of a fat lazy bear.

Don't get me wrong here, but I have NEVER seen anything that you made that has not already done. I work with code I find and try to expand my knowledge, but I do not try to claim it as MY code!

When he gets desperate, he runs to Network54 lol.
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0

User avatar
Codemss
Veteran
Posts: 124
Joined: Sun Jun 24, 2007 6:49 am
Location: Utrecht, The Netherlands
Contact:

Post by Codemss » Wed Dec 19, 2007 3:23 pm

Damn. Please, be reasonable. I already said sorry for forgetting. Too much weed probably. Anyway, try to tell why you lose your mind before you lose your mind.

What code you mean? I never credit someone's other code, so if it happens, it's accidentally. But please, tell me about it.
I don't play a game. I am no master coder, but I try to help by writing tutorials for QBE and helping on the forum instead of bullshitting them. If you are so good, you might try that too.
Yes you're right. I sit back like a lazy bear. That's chill. I like it.
Now tell me what you want or else fork off.
And yeah, I post here when I have a problem with coding. Isn't that where forums are for?

Sorry if this post may seem offensive. Ignore it. The main question in it is:
??? are you talking about? What code? What text graphics stuff? What credits?
Please, I've been very nice to you. I said sorry. I asked very nice what you were talking about. You've just been pissing me off.
Check out my site: <a href="http://members.lycos.nl/rubynl">Click here</a>
Hope you like it. Send some feedback if you want: <a href="mailto:basicallybest@live.nl">Mail me</a>
Codemss, before known as RubyNL

User avatar
Lachie Dazdarian
Veteran
Posts: 204
Joined: Mon Aug 30, 2004 6:18 am
Location: Croatia
Contact:

Post by Lachie Dazdarian » Wed Dec 19, 2007 4:57 pm

Codemss, ignore the douchebag. You know, you wouldn't get this sort of lame crap in the FB community so move to FB already. Ok, your would get some other kind of crap from time to time. But I can guarantee you it wouldn't be lame. ;)
Lachie Dazdarian - The Maker Of Stuff

User avatar
Codemss
Veteran
Posts: 124
Joined: Sun Jun 24, 2007 6:49 am
Location: Utrecht, The Netherlands
Contact:

Post by Codemss » Wed Dec 19, 2007 5:05 pm

Thanks. BTW I already know that Freebasic is the future, QB is the past.

I had some problems with compiling, but I am gonna move on to FB soon, I think. Maybe I will release a Qbasic demo soon(with Optimus). After that I'm definately done with QB.
Check out my site: <a href="http://members.lycos.nl/rubynl">Click here</a>
Hope you like it. Send some feedback if you want: <a href="mailto:basicallybest@live.nl">Mail me</a>
Codemss, before known as RubyNL

User avatar
burger2227
Veteran
Posts: 2409
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Post by burger2227 » Fri Dec 21, 2007 1:54 pm

Well, you might as well freeload there. All I asked was a simple question and you seem to be oblivious to what I asked.

I for one will not miss your numerous posts about doing things in QB, but the FB community should get their fair shake! It is only fair to them that you steal their ideas too! I hope they have crayons..............

The code allowed you to use graphical text (Ildurest) and my particular routine made the text larger. I also made a graphic scroller that works way better than ASCII text would. Ring any bells?

I gather FB is so desperate for worshipers, they will take anybody.

Ted
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0

User avatar
Nodtveidt
Veteran
Posts: 826
Joined: Sun Jul 25, 2004 4:24 am
Location: Quebradillas, PR
Contact:

Post by Nodtveidt » Fri Dec 21, 2007 2:23 pm

burger, if you don't start shutting the fork up with your shit, I'm going to petition for your forceful removal from this forum.

roy
Veteran
Posts: 55
Joined: Sun Jul 29, 2007 2:39 pm
Location: London

Post by roy » Sat Dec 22, 2007 12:35 pm

With that language I think you should be banned.
PS
Trolls can not be eaten. Answer and you have lost, don't answer and you are a wimp.
PPS
To beat a troll you have to delete his post, the way V1ctor does at FB. lol

User avatar
burger2227
Veteran
Posts: 2409
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Post by burger2227 » Sat Dec 22, 2007 2:04 pm

Talk like the moron you are if you like. You TROLL this place like a lost child looking for something to say! I would not try a petition until you clean up all of your nasty posts.

N, I cannot figure why anybody here even tolerates your childishness. Do you realize that 12 year olds that are smarter than you come here to honestly learn how to code. What do you come here for? Choose your weapon because, so far, I have not heard you say a nice thing about any programming language! Except for the swearing one.

GROW UP and use some intellegence, if you have any, when dealing with me! I have every right to be pissed!

He takes our code, promises to give us credit then HE takes credit for it.
Why should anybody have to put his name on code he probably needed a lot of help to make in the first place?

When he first started coding, he was tough to teach and he would disappear for weeks until his next project. That won't change a the FB forum, so I honestly feel sorry for them in a way.

Credit or THANKS is something hard to say I guess? So he will get none either!

Ted
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0

roy
Veteran
Posts: 55
Joined: Sun Jul 29, 2007 2:39 pm
Location: London

Post by roy » Sat Dec 22, 2007 2:57 pm

I can back burger2227 on this one because I was one of the first people trying to help rubyNL. A couple of weeks after being a pain to teach he was asking for help on Raycasters.

User avatar
Lachie Dazdarian
Veteran
Posts: 204
Joined: Mon Aug 30, 2004 6:18 am
Location: Croatia
Contact:

Post by Lachie Dazdarian » Sat Dec 22, 2007 4:01 pm

Could you please present some code where Codemss uses your code and does not credit you? From the code displayed here, this is not the case. If he tossed out your code, get your shit together and stop whining about it. Shees! I can?t believe what anal fork you are regarding your code (which is not used for that matter).

Teach for the pleasure of making a coder or a game designer from someone who was not one before, and not for being a credit-whore.
Lachie Dazdarian - The Maker Of Stuff

roy
Veteran
Posts: 55
Joined: Sun Jul 29, 2007 2:39 pm
Location: London

Post by roy » Sat Dec 22, 2007 4:08 pm

Lachie ,
The first sign of a loser is when he starts swearing.
PS
Just look through the posts concerning RubyNL at network54.
PPS
I got banned from Fb.net for calling new members morons and now they have got Ruby. My case stands.

User avatar
Nodtveidt
Veteran
Posts: 826
Joined: Sun Jul 25, 2004 4:24 am
Location: Quebradillas, PR
Contact:

Post by Nodtveidt » Sat Dec 22, 2007 4:55 pm

Credit whores are irritating. I've helped hundreds of people over the years without so much as a single thank you and I never gave a damn because it's all about the learning experience.

roy: that's not quite true. When you start swearing and insulting someone, you've lost the debate. It's not the sign of a loser, but it just might be the sign of someone who is fork sick and tired of all the bullshit. Oops...case in point.

burger: Sorry kiddo, I've accepted the fact that you are nothing more than a slobbering troll with no social graces whatsoever. From here on, I refuse to answer any of your inane drivel or flamebait posts. Happy trails, Rumpelstiltskin.

roy
Veteran
Posts: 55
Joined: Sun Jul 29, 2007 2:39 pm
Location: London

Post by roy » Sat Dec 22, 2007 5:53 pm

I have never asked for a thank you when I help someone and if I did write a program it woulld not bother me if I was not credited but please be honest.

User avatar
burger2227
Veteran
Posts: 2409
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

He made a promise, but who knows?

Post by burger2227 » Sun Dec 23, 2007 2:03 am

My code is free to use and you NEVER have to give me ANY credit! But don't post your code later and say, I did it all and I want credit if you even use part of it. That is totally IGNORANT after all we all helped the man do basic stuff (no pun intended)! I think he has come a long way, but he forgot how he got there!

N, Find somebody else to follow around because I am not your daddy and you will likely have to look elsewhere. I can't imagine why he left you in the dust! You weren't cussing in the womb were you?

He has actually never posted any of our code that I am aware of to date. The "credit whore" made the FIRST post!

Ted

Lachie, smile once in a while. Don't take the bridge please!
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0

User avatar
Seb McClouth
Veteran
Posts: 342
Joined: Wed Nov 09, 2005 7:47 am
Location: Inside the Matrix...
Contact:

Post by Seb McClouth » Sun Dec 23, 2007 5:26 am

Peace on Earth and good will towards all mankind...
QBinux is a Linux distribution with the aim of integrating the work of the vast community of free software developers at Pete's QBASIC Site in order to create a modern, performant, safe and easy to use system for system administrators and desktop users.

nkk_kan
Veteran
Posts: 57
Joined: Thu Jun 01, 2006 10:45 am
Location: Gujrat,India,Asia
Contact:

Post by nkk_kan » Sun Dec 23, 2007 8:01 am

seconded seb..

peace out guys..
it's just as lachie told
Teach for the pleasure of making a coder or a game designer from someone who was not one before, and not for being a credit-whore.

Post Reply