Where to find scrolling background examples?
Where to find scrolling background examples?
Is there an example code somewhere of usage of scrolling background, like for usage in a jump and run type of game.
Or where should I look in the manual to learn about this?
Or where should I look in the manual to learn about this?
Re: Where to find scrolling background examples?
i think the command DisplayBGPicPart or displaybrushpart is what you are lookng just load longer picture and display a shifted image every time
Christos
- airsoftsoftwair
- Posts: 5425
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: Where to find scrolling background examples?
Jump'n'run games usually compose the background by combining a set of small tiles. Scrolling is then achieved by offsetting the tiles.
- Juan Carlos
- Posts: 885
- Joined: Mon Sep 06, 2010 1:02 pm
Re: Where to find scrolling background examples?
The only example that I have seen to do this is the Boing Ball against SubZero and the demo Game is slow, because Hollywood can'ts mover background, sprites, read the las to mover the SubZero, I think that Hollywood is not the ideal programing language to make games like jump and run, shoot, plataform, cars, etc.
Re: Where to find scrolling background examples?
There are different ways to achieve scrolling, and while Juan Carlos is right that Hollywood isnt ideal for jump n runs, I however see no reason not to use Hollywood for that, since there isnt anything inherently problematic either.
That thing is, if you are making scrolling for Classic Amigas, then forget about Hollywood, it is simply too heavy to be used. But then again, Hollywood isnt really ideal for anything Amiga Classics, since Hollywood is aimed at more powerful machines.
You could compare this to Java. If you plan on making a game for Classic Amigas, you dont use Java for that, since that would be terrible choice for Classic Amigas, since Java is meant to be used by heavily powered machines. Theres nothing inherently wrong with Java (or Hollywood) it is just that they are not aimed at Classic Amigas.
That explained, Hollywood can handle Jump n run just like other heavy powered machine aimed languages can. As long as you have a heavy powered machine, it works just fine.
Also, if you need faster scrolling for some reason, you can use for example SDL library commands to not use Hollywood own systems but SDL system then, hence making Hollywood sort of becoming the ideal language for jump n run games (just like any other SDL etc. supporting languages).
I am telling you here two examples on how to make scrolling.
First one is to make a very big brush. Lets say you have 320x200 screen. You could make then 640x200 sized brush.
If you display this brush at location 0,0, then you will see only first 320 pixels. display it at location 1,0, and you will see pixels 1 - 321. And this way by keeping showing 1 more pixel each time, it will look like it is scrolling.
Basically this is bit clumsy way of achieving scrolling, since supposing you want to make Super Mario Bros 1 first level, you will need in this examples case maybe 6400 x 200 sized brush, which means it needs quite much memory. However, modern machines have whole load of memory, so while this had been out of question on Amiga 500 times, this is quite doable nowadays.
To have something bit similar is to use this and tiles approach.
You could have for example 352 x 200 sized brush. I picked this size based upon that you would basically be using 32x32 pixel tiles on 320x200 screen.
Idea is that first you use those tiles to make that brush.
you would have table telling what tiles at what point come. as example:
Idea being that this is x and y co-ordinate. the [0] being x, and rest numbers being y.
using this info you know which tile to put on that brush to where.
for example tile number 0 would be put to location 0,0, and tile numbr 0 would come to location 32,0 as well, then tile number 1 to location 64,0...
Now this big brush would be shown on one of locations 0,0 to 32,0.
If after location 32,0 location becomes bigger (as in 33), then big brush would be shown at location 0,0 again. However, big brush would be updated by taking tiles from one further to the right, or in this case, leaving the lines first numbers out, which would be 0 and 1 in this example table [0] and [1] lines first numbers.
this way it would look like screen is scrolling forward and instead of needing 6400x200 brush, you survive with just 352x200 brush.
similarly if big brush is at location 0,0, and it is supposed to move left (as in -1,0) then big brush jumps to 32,0 location and brush is updated by getting one more numbers from left side, in this case includin 0 and 1 again from [0] and [1] tables.
That thing is, if you are making scrolling for Classic Amigas, then forget about Hollywood, it is simply too heavy to be used. But then again, Hollywood isnt really ideal for anything Amiga Classics, since Hollywood is aimed at more powerful machines.
You could compare this to Java. If you plan on making a game for Classic Amigas, you dont use Java for that, since that would be terrible choice for Classic Amigas, since Java is meant to be used by heavily powered machines. Theres nothing inherently wrong with Java (or Hollywood) it is just that they are not aimed at Classic Amigas.
That explained, Hollywood can handle Jump n run just like other heavy powered machine aimed languages can. As long as you have a heavy powered machine, it works just fine.
Also, if you need faster scrolling for some reason, you can use for example SDL library commands to not use Hollywood own systems but SDL system then, hence making Hollywood sort of becoming the ideal language for jump n run games (just like any other SDL etc. supporting languages).
I am telling you here two examples on how to make scrolling.
First one is to make a very big brush. Lets say you have 320x200 screen. You could make then 640x200 sized brush.
If you display this brush at location 0,0, then you will see only first 320 pixels. display it at location 1,0, and you will see pixels 1 - 321. And this way by keeping showing 1 more pixel each time, it will look like it is scrolling.
Basically this is bit clumsy way of achieving scrolling, since supposing you want to make Super Mario Bros 1 first level, you will need in this examples case maybe 6400 x 200 sized brush, which means it needs quite much memory. However, modern machines have whole load of memory, so while this had been out of question on Amiga 500 times, this is quite doable nowadays.
To have something bit similar is to use this and tiles approach.
You could have for example 352 x 200 sized brush. I picked this size based upon that you would basically be using 32x32 pixel tiles on 320x200 screen.
Idea is that first you use those tiles to make that brush.
you would have table telling what tiles at what point come. as example:
Code: Select all
mariolevel1 = {
[0] = {0, 0, 1, 2, 1, 0, 0...}
[1] = {1, 2, 0, 0, 3, 0, 0...}
[2]...
}
using this info you know which tile to put on that brush to where.
for example tile number 0 would be put to location 0,0, and tile numbr 0 would come to location 32,0 as well, then tile number 1 to location 64,0...
Now this big brush would be shown on one of locations 0,0 to 32,0.
If after location 32,0 location becomes bigger (as in 33), then big brush would be shown at location 0,0 again. However, big brush would be updated by taking tiles from one further to the right, or in this case, leaving the lines first numbers out, which would be 0 and 1 in this example table [0] and [1] lines first numbers.
this way it would look like screen is scrolling forward and instead of needing 6400x200 brush, you survive with just 352x200 brush.
similarly if big brush is at location 0,0, and it is supposed to move left (as in -1,0) then big brush jumps to 32,0 location and brush is updated by getting one more numbers from left side, in this case includin 0 and 1 again from [0] and [1] tables.
Re: Where to find scrolling background examples?
Thanks for the replies.
I will try DisplayBGPicPart first, since it was easier for me to understand.
All those tiles confuse me a bit
I will try DisplayBGPicPart first, since it was easier for me to understand.
All those tiles confuse me a bit
-
- Posts: 475
- Joined: Fri May 15, 2015 5:15 pm
- Location: Waterville, Minnesota USA
Re: Where to find scrolling background examples?
For an editor and example pictures, see https://www.mapeditor.org/. Tiled should work on your Mac already. Then just use the Lua exporter to make the tables.
I'm on registered MorphOS using FlowStudio.
- Juan Carlos
- Posts: 885
- Joined: Mon Sep 06, 2010 1:02 pm
Re: Where to find scrolling background examples?
Here is an early christmas present... Download tilemap sample and start scrolling those tilemaps...
test.hws - Shows how to setup draw object, load tilemap data, setup viewport object and how to draw and move tilemap.
maped.hws - Simple tilemap editor. Load tiles image, setup tilemap and paint tiles. Use cursor keys to scroll map and mouse wheel to scroll tile palette. Finished map can be saved to file and saved files can naturally be opened later on.
Example tileset and tilemap is located inside data directory.
Code should handle the most tilemap functionality. You can even make the viewport bounce around the screen as you scroll your tilemap...
I have only old version of Hollywood, so I hope it still works...
test.hws - Shows how to setup draw object, load tilemap data, setup viewport object and how to draw and move tilemap.
maped.hws - Simple tilemap editor. Load tiles image, setup tilemap and paint tiles. Use cursor keys to scroll map and mouse wheel to scroll tile palette. Finished map can be saved to file and saved files can naturally be opened later on.
Example tileset and tilemap is located inside data directory.
Code should handle the most tilemap functionality. You can even make the viewport bounce around the screen as you scroll your tilemap...
I have only old version of Hollywood, so I hope it still works...
Re: Where to find scrolling background examples?
Thank you. I will check it out