Blitz Basic 2 basics
This thread is for questions on the very basics.
|
First questions using Inkey$ with raw key codes How?
|
Inkey$ is used to take input from the current input stream, but it won't work in the Shell if that's what you're trying to do? Edit$ is used instead for taking a whole line. Also, from memory, Inkey$ gives you a cooked key, nor a rawkey, though I don't think that would make much of a difference.
What exactly are you trying to do? |
So im in Blitz mode and want to control my objects from keyboard instead of joystick
A$=inkey If a$="a" print " a" End if Repeat but instead of a$="a" I want to use the Raw keycodes |
Ah, ok. Well then Inkey$ probably isn't what you want then. You'll need to use the RawStatus() function and provide it with the rawkey code you're looking for. For example:
Code:
If RawStatus($45) Edit: Rawkey codes are laid out on a page at the back of the Blitz manual, but appear to be missing from the online manual. The codes can be found here in the first column. |
Brilliant ill try it out
|
Cool. Apparently you also need to have the command
Blitzkeys On after you go into Blitz mode to enable reading of the keyboard... |
Excellent
|
We have a palette
0=Purple 1=Black 2=White 3=Orange Cls 3 - an Orange Screen Using Print Command Change the Colour of the Text to White 2 and the border around the text to Black 1? |
Use the Colour command before the Print command:
Colour 2, 1 should work... You don't have to provide the second parameter, in which case the background will be whatever the background colour is on the bitmap. |
Quote:
I hope this thread will be helpful for other people as well. |
Yep, it's only for when you're outputting text to a bitmap specifically.
|
Thanks again - now what question next:spin:confused
|
I have a question, what is the fastest method of using blockscroll without getting flicker? Now I use double buffering and BitMapCopy but is there a better way? This is probably a very stupid way of doing it
|
Hmmm, I don't really know about blockscrolling as I haven't really used it... Are you sure you're synchronising with the vertical blank though? What part of the display flickers?
|
The whole screen flickers if I don't use double buffering, but the way I do double buffering now is probably very inefficient. I'm trying to figure out how to do 8way scrolling with a large tilemap, I haven't found any example how to do this. I was thinking of using blockscroll and drawing only blocks coming in. It's working in one direction now but probably very inefficient. This is my code:
Code:
; TILEMAP TEST |
Hmmm... You're copying the whole bitmap every frame? I don't think you would need to do that - just do the blocks that need to be redrawn on each bitmap as needed and swap it out. Copy the bitmap at the start before you enter the main loop and you should be fine. Other than that it looks ok to me, but I haven't tested it...
|
Next Question What does Blockscroll do?
Full hardware scrolling was done like this http://eab.abime.net/showthread.php?t=80646 or/and http://eab.abime.net/showthread.php?t=81634 or a large screen but this is a whole other thread :) You can use DisplayBitMap to scroll the screen. |
Ok thanks, so I need to handle the scrolling for both bitmaps separately somehow since they get "out of sync" every frame if scrolling.
|
Quote:
I have been looking at the full hardware scrolling and have managed to do horisontal scrolling in both directions using corkscew with a 100 screen wide tilemap. First I did it with DisplayBitMap and copperlists but there seems to be a bug in DisplayBitMap, setting an x-value over 8191 ($1fff) will offset and garble the screen (so max 26 screens possible). When I switched to using slices it worked for at least 100 screens, didn't try anything bigger. Doing 8way hardware scrolling is more complicated though. |
All times are GMT +2. The time now is 19:47. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.