|
Layers
Dec 15, 2018 13:59:33 GMT -6
Post by johnno56 on Dec 15, 2018 13:59:33 GMT -6
Does RC have the ability to display images in layers? Similar to the parallax effect in "The Beast" demo. A quick glance at the listing implied that the "furthermost" image is displayed first then each following image and moving each image in order. Not sure if I am explaining it correctly. Example: A character starts walking through a forest from screen left to screen right. Most people would walk through and around the trees. Most games would have the character walking in the foreground. Please do not try to write this example as it is just that, an example. I would like to know if it is possible.
The reason for asking is that: I have a few sdlbasic listings that I wold like to convert. Sdlbasic is primarily a 2D application but it can simulate the Z axis. Like most applications, the image is placed at x,y on the screen, Sdl also has the ability to create 1024 Z layers to give the 'appearance' of depth.
All I need to know is, if 'yes' then how is it done? If 'no' then no big deal, I'll just move on to something else...
|
|
|
Layers
Dec 15, 2018 16:54:49 GMT -6
via mobile
Post by tbird on Dec 15, 2018 16:54:49 GMT -6
As far as I know, layers or the draw order or z-depth in RCBASIC is completely dependant on the creator to implement.
That's why in my framework I have to create and manage the layers, I have been working on a draw routine that let's you set individual z depth, but it's not complete.
So you would have to have an array for which is drawn and have it sorted and resort if you change a z value etc... where as SDLBASIC has this feature built-in.
For a simple side scroller it's just as you said, the order of the draw image command, and for top down z sorting, I asked a question on here and use n00bs example he gave me for auto z sorting objects with "height".
|
|
|
Layers
Dec 15, 2018 17:29:08 GMT -6
Post by n00b on Dec 15, 2018 17:29:08 GMT -6
Everything TBird said is correct. The only thing I would add is that you can change the draw order of Canvases with SetCanvasZ () but there are only 8 canvases.
|
|
|
Layers
Dec 15, 2018 22:16:52 GMT -6
Post by johnno56 on Dec 15, 2018 22:16:52 GMT -6
Thanks for the advice guys. Much appreciated. So, the answer would be 'yes', but with a little extra work...
Just thought of another question: Do RCBasic useres still use joysticks or are they (the sticks NOT the users) fading into obscurity?
J
|
|
|
Layers
Dec 15, 2018 23:48:48 GMT -6
Post by n00b on Dec 15, 2018 23:48:48 GMT -6
I personally use a logitech game controller but I do own a flight stick.
|
|
|
Layers
Dec 16, 2018 1:05:37 GMT -6
Post by johnno56 on Dec 16, 2018 1:05:37 GMT -6
It's just that I have a Joystick on my upper desk shelf gathering dust. All my old flight sims were Windows based, seeing I now only use Linux, both the simulators (and by default) the stick are no longer in use.
Has anyone built a simple 'basic coded' flightsim with RCBasic (or similar) and if not do you think it could be done? I think a 'sim', like MS Flight Simulator, maybe a major stretch for most Basics, but how about a 'wireframe' (vector) similar to Atari's Battlezone. I'm trying to generate ideas... It doesn't happen that often... lol Too big too soon? I'm open to suggestions...
|
|
|
Layers
Dec 16, 2018 9:54:16 GMT -6
Post by tbird on Dec 16, 2018 9:54:16 GMT -6
Personally what I would do to get a hang of simple physics that would be involved is look into making a version on lunar lander, once you have that then you have all the knowledge how to do introductory physics, gravity, friction, center of balance or center of gravity, etc.. that's my idea. Also some of the original versions were written in BASIC lol.
|
|
|
Layers
Dec 16, 2018 13:51:30 GMT -6
Post by johnno56 on Dec 16, 2018 13:51:30 GMT -6
Cool. Lunar Lander it is... That brings back memories... Correct me if I am wrong, RCBasic does not have collision detection 'built in", right? So, a simple 'bounding box' system, would probably work? Hmm... With only one moving image, I suppose 'getPixel', shouldn't slow thing down too much... Oh. A landscape generator or pre-drawn... Cool. Ideas. Thank you for the suggestion...
J
|
|
|
Layers
Dec 16, 2018 13:53:12 GMT -6
Post by n00b on Dec 16, 2018 13:53:12 GMT -6
RCBasic is capable of some mode 7 style effects. I was going to make a tutorial on it at some point but I just never got around to it. You can just google mode 7 tutorial to see how it works but basically the effect is achieved by dividing the (x, y) values by the z value of where it is located in 3D space. I will post some code on this later today.
|
|
|
Layers
Dec 16, 2018 16:14:31 GMT -6
Post by johnno56 on Dec 16, 2018 16:14:31 GMT -6
Isn't that the way with tutorials? lol Whatever and whenever you can put something together will be fine. I've heard of 'Mode 7' but have not had the urge to look into it... No time like the present...
Thank you.
J
|
|