Yes, the terrains are individual sprites. You can also download the sample projects I link to in this thread. http://scratch.mit.edu/forums/viewtopic.php?id=2440
Offline
Thanks archmage. I am doing a project for uni, basic project. We are going to create a shooter style scroll game, like contra.
I have already tried the code in seperate sprites and drop the sprites 10 layers. that seemed to work perfectly.
I have a problem with the things my character stands on, if I use a sprite, then the character sometimes gets stuck, or, letssay his gun touches the sprite at a drop, the character could stay on the ledge just by his gun, becuase he is "touching spirte", so I used the " touching colour" code, and that works, but not all the time, I think this is a problem with scratch? not sure.
Offline
Yeah, while the tutorial I explained explains scrolling collision detection and movement is not explained. Instead of writing tutorials I have created some projects that give examples of things like shooting and collision detection.
Here are some projects that relate to your problems. Download them and check out the code
http://scratch.mit.edu/projects/archmage/112445
http://scratch.mit.edu/projects/archmage/635312
http://scratch.mit.edu/projects/archmage/101212
Every thing you want to make seems possible. If you mash together the scripts from the above projects making a contra clone should not be too difficult.
Also, I have made many different example projects that help with things like sorting lists, changing costumes, and collision detection. You could probably learn a lot from going though my projects.
Last edited by archmage (2009-09-10 14:13:42)
Offline
Thanks for your help.
I have already programmed the bullet as a seperate sprite, and then the option of picking up different ammo packs, changes bullets, damage etc.
Also coding which restricts the character from shooting behind him, so if facing forward the character would have to turn left to shoot towards a smaller X axis position and vice versa.
I have created seperate sprites for terrains, and I think I will go with the option of actually drawing the platfroms on each terrain sprite, and use "if touching colour".
sprite has a lag problem in between x axis ( 480 * 1) (480 * 2 ) etc, so the stage needs to be a colour which hides the transition between platforms or terrains at these points.
any thoughts on 8 bit music(royalty free sounds), or should I compose it myself with audio plug-ins for a DAW?
Offline
If you are looking for royalty free music is the place you want to go to is http://www.newgrounds.com/audio/. A lot of flash developers use it for music as well.
Offline
You can't make any save data in scratch. However you can use the method that some older games used for saving progress and use passwords. Each password would warp the player to a different point in the game.
Offline
Nice. another thing is, that when my game is run, the character can move backwards into negative x axis and runs of the platform, how can I create a block to stop him? I have a sprite called, stopLeft and stopRight, but because the are hidden it doesnt stop hom, or should I just set an if statement "if x position = x postion of stopLeft change cX, the variable I created, change cX by 0. cX is linked to X.
Offline
You could just create a big all to stop him. Or you can use a script like this
if (scrollX<0){
set scrollX to 0
}
Offline
Hello archmage, I need your help with this.
In the platform game i am working on, I have made the platforms, different sprites, which scrolls perfectly, but what if I want to set everything back to how it was when the flag was clicked.
For example. when the player passes the stage, I want everything to go back to the beginning, or should I just add more platform sprites, but i think this is slowing the game down.
I see in your archknights game, there is only 2 platforms that change cosutmes, how would I link that to scrollX?
advice please
thanks
Offline
http://scratch.mit.edu/forums/viewtopic.php?id=2440
Look at method 2, its really preferable if you have a lot of terrain.
If you want things to go back to the beginning you could try resetting the scrollX variable.
Last edited by archmage (2009-09-17 15:36:49)
Offline
Resetting the variable should work. What happens when you try this? Also, keep in mind that projects work very differently in the online player so you may want to test it online if you are going to upload the final version.
Offline
That's great thanks, but what do I use to control scrollX , should I link it to the movement of the character? another thing, why does velocity decrease by 2 if the character moves right? also , what do I start the values(terrainCostume, scrollX, velocityX) on, 0 ??
Thanks in advance
Offline
1. Use scripts that use the arrow keys to change xVel to change scrollX
2.Velocity decreases by 2 because the terrain is moving left
3. I guess you should have everything set at 0
http://scratch.mit.edu/projects/archmage/635312
Try using the code in this project as an example. The code is clean and easy to understand. You could try to copy its scripts into your project.
Offline
I know my project works, and yours has code like mine so in theory it should work the same. Since it does not work the same it means you did something wrong. You need to closely compare everything in my project to your project and pinpoint the issue in your project.
Also keep in mind that with the 2 terrain method both terrain sprites need to have the same costumes in the same order.
If you have tried for many hours and still cannot fix the issue, you could upload your project for a little bit for people to take a look at it and tell you what is wrong with it.
Last edited by archmage (2009-09-21 12:43:08)
Offline
I am sticking with the multi sprite method, another thing, I have set my monster sprites to positions using the same code as the platforms, i set them to scrollX + 480 * (terrain number). but even thought they are positioned there, they don't hide like the terrains do? they stick a little into the screen on the right, and scroll with the screen until the character gets to the position then it stops scrolling?
Any ideas?
Offline
The monsters should not stop scrolling. You could try looking up the monster code in the example I posted.
Offline