Hello, I am 12 years old. I am making something very similiar to SnackaCat, a game created previously by Dthen, and I used the game's coding to help. I've already made the basics of the game: the cat is aimed with the mouse and spacebar is used to control, collecting the items, getting points, time limits, ect. I want to add some more things to my game, like the cat has to dodge people and other animals to get the item, but if it hits the people/animals it loses a life. How can I do that? Also how do you make a person/other animal move across the screen? Is there a way I can get the game to go a higher level, like level 2, 3, and so on? If so, how? And if you don't mind another question, I would like to know how to make a extra item that rarely comes on the screen that gives you more points than the normal items. I'm new to this so please explain what coding to put if you can. I want to make this game as good as it can get. I apreciatte your replies!
-Pachipachi
Offline
Good for you for trying to add new features to your game! The way I learn how to add new features is I look for projects that have a feature that I like, then I download them and look at the code to figure out how they made the feature. Then, I make a small project and try to build the feature myself, adding one small thing at a time, testing it again and again until it does what I want.
You have asked for help on a lot of different items: let me address the Lives one and let others take on the rest of the list. To add Lives to a project is pretty easy. Define a variable called Lives that can be seen by all sprites. Set it to the number you want to start with on a Green Flag script somewhere. Then set up the poison objects that are going to take lives away. The poison objects can be sprites or they can be specially colored items painted on the background, it all depends on how you want to sense them. If they are sprites, you can simply add blocks to the poison sprites that say "If touching <your good guy sprite>, change Lives by -1" . If you are using specially colored items, you will need to add blocks to your good guy, something like "if touching <color of poison items>, change Lives by -1". The last thing you might want is something to happen when you run out of lives. This can be done with a set of blocks run off a Green Flag hat saying something like "wait until <Lives = 0>, say Game Over, stop all" . Good luck, I hope that helps.
Offline
Thank you, that helped!
I will be letting everyone see a preview of the game as soon as the first level is complete.
Offline
Ok, yay! Got the life thing down. I also have score and time- I think I'll be able to make more levels, but since there is a timer, I need a little help. In the game the cat has to collect muffins (lol!). I want it to be that the cat has to get atleast five muffins on the first level before the time runs out, then when the time runs out (if the cat has five muffins or more) it will take her to the next level.
Offline
archmage made a pretty good project avout movement. here is the link: http://scratch.mit.edu/projects/archmage/72848
you should see how it works, then maybe use his script in your project.
Offline
ok, i'l try to help with the level thing...
first make a variable called muffins. then use these 2 scripts for the cat or whatever the character is
<when green flag clicked>
<forever>
<if> <touching[ muffin
<change{ muffins }by( 1
<when green flag clicked>
<reset timer>
<forever>
<if> <( <{ level }> <=> 1 )>
<wait until><( <timer> <>> 179 )>
<if> <( <{ muffins }> <>> 4 )>
<change{ level }by( 1
<else>
<set{ level }to( 1
something like that. i hope i helped!
Last edited by funkymonkey (2008-01-05 12:48:49)
Offline
Thank you guys! -goes to trie-
...ok, I coded in the muffin thing. Looks like I'm having trouble coding in level 2 though. D:
Offline
what do you mean? what is the problem
Offline
I'm not excactly sure how to make level 2... I thought I could but, turns out it's more complicated for me. D:
Last edited by pachipachi (2008-01-05 11:23:54)
Offline
funkymonkey, you never want to use "timer =180", because the timer can be 179.95 one time you check it, and 180.12 the next time. You always want to use the "timer > " test, rather than an equality test.
Offline
kevin_karplus wrote:
funkymonkey, you never want to use "timer =180", because the timer can be 179.95 one time you check it, and 180.12 the next time. You always want to use the "timer > " test, rather than an equality test.
ok, and also i forgot to add the <reset timer> block in the begginig, because that is pretty important too. i;ll edit it now
Offline
pachipachi wrote:
I'm not excactly sure how to make level 2... I thought I could but, turns out it's more complicated for me. D:
what do you want to happen in level 2?
Offline
I'm getting it... I played around with it and got the next level. I've added a new background and made the enemy dog faster. I got rid of the timer, especially since the game will get very hard on further levels.
I want to add another enemy dog but I'm not sure how. I can make another sprite for the new enemy dog but how do I keep it from being in level 1? Oh, and how can I make it so that now you have to have 10 muffins to complete level 2?
Last edited by pachipachi (2008-01-05 12:14:51)
Offline
you need to have a variable called level. it will make everything easier i think. first im going to edit the first scripts that i gave you, using the level variable
Offline
here's for level 2:
<when green flag clicked>
<forever>
<if> <( <{ level }> <=> 2 )>
<wait until><( <timer> <>> 179 )>
<if> <( <{ muffins }> <>> 9 )>
<change{ level }by( 1
<else>
<set{ level }to( 2
its basically the same thing as level 1, only with numbers switched a little
Last edited by funkymonkey (2008-01-05 12:50:27)
Offline
Ok, thanks. I have already made a variable called level, and I've been successful in getting the level to work, but I want to put in things that won't show up in any other levels, like another enemy.
Offline
oh, ok. so for an ememy, give it this script:
<when green flag clicked>
<forever>
<if> <( <{ level }> <=> 1 )>
<hide>
<end>
<if> <( <{ level }> <=> 2 )>
<show>
<end>
<end>
if you want it to be in every level except the first, then do this:
<when green flag clicked>
<forever>
<if> <( <{ level }> <=> 1 )>
<hide>
<end>
<if> <( <{ level }> <>> 1 )>
<show>
<end>
<end>
Last edited by funkymonkey (2008-01-05 12:54:35)
Offline
pachipachi wrote:
I am making something very similiar to SnackaCat
what is the link to SnakaCat? i want to see it
Offline
Thanks! Here is the Snackacat link:
http://scratch.mit.edu/projects/Dthen/3801
Last edited by pachipachi (2008-01-05 12:55:44)
Offline
pachipachi wrote:
Thanks! Here is the Snackacat link:
http://scratch.mit.edu/projects/Dthen/3801
thanks. after looking at that, i think you should add a high score table for your version in the description or something. it wuld make it funner to try to beat someone else's record
Offline
Your welcome. I'll be sure to add a high score table.
Offline
do you still need any help?
Offline
Ok, I need a little help! The bar which tells what level you're on isn't working right. When I get to the second level, instead of the level bar going from 1 to 2, it goes crazy and continously goes up.
Offline
oops. thats because of the forever block. so i think it will work normally if you just use this:
<when green flag clicked>
<if> <( <{ level }> <=> 2 )>
<wait until><( <timer> <>> 179 )>
<if> <( <{ muffins }> <>> 9 )>
<change{ level }by( 1
<else>
<set{ level }to( 2
but im not exactly sure
Last edited by funkymonkey (2008-01-05 16:27:40)
Offline
Thanks, I'll use it if it messes up again... lol. It fixed itself! o_O Odd. I'll post if I need help again!
Offline