Game Maker's Garage Forum
Game Creation => GameMaker => Topic started by: Zoo on March 08, 2011, 04:39:44 PM
-
I'm making a game where you control a mouse and try to collect cheese dropping from the sky. To bad for you though, because cats are also falling. I need a code to to drop the cat/ cheese over and over again until you get hit by a cat, or until time is up for that level.
It will be totally cool, and i'll put you in the credits.
Thanks,
-zoo
-
you definitely need to use the random variable.
try this: (put loopscript on)
IF level = 0 THEN level = 1
ONTIMER 5000 level = level + 1
chance = random 10
cat_chance = level
IF chance > cat_chance THEN
'enter cheese falling variable
ELSE
'enter cat falling variables
END IF
delay 100
I entered cat_chance as a separate variable from level, in case you wanted to incorporate a power-up that temporarily modifies the chance of falling cats
Also you may want to make the one-hundred after delay a different number, so objects can fall more frequently or vice versa
-
I need loopscript for the mouse to work so it's good that this will work.
-
Cool, if you do use this matrix will you please put my name as Kurt L. Manion,
Good luck on your game :)
-
Hmm. all that seems to do is make the sprite of the mouse move choppier and laggier.
-
Hmm. all that seems to do is make the sprite of the mouse move choppier and laggier.
Maybe thats because of all the info it has to process with the additional timer, it has to do that code in between the time it updates the sprite's position.
Are you using the custom cursor code we developed earlier as a character, or an actual custom mouse?
If your using the custom cursor code as a mouse variable, I never tested it for in game use. It might only be useful for point-and-click. You might might want to try the other method the other developers came up with in that case
If it's being used to control a character, then perhaps you should try this
ON MOUSEDOWN
x = mousehorz
SPRITE x {where the top of the sprite should lie} mouse.gif
END MOUSEDOWN
-
yeah, i'm using the custom cursor thingy. that doesn't work either, maybe I'll use the WASD for movement instead.
-
yeah, i'm using the custom cursor thingy. that doesn't work either, maybe I'll use the WASD for movement instead.
were you originally trying to make the mouse follow the mouse?
-
Yeah, I was messing with your custom cursor code, and I had a picture of a mouse when I got the idea. A mouse mouse is a good idea.
-
Yeah, I was messing with your custom cursor code, and I had a picture of a mouse when I got the idea. A mouse mouse is a good idea.
lol, a mouse mouse is a good idea.
If you still want to make it mouse oriented, but not too easy to play, you could use the SPRITEPATH command that Al posted in the SPRITE animation thread, you just have to make a Y value parameter, so that the mouse can't fly, but will follow your mouse when ever you click. That way it won't be as glitchy as constantly following the mouse, but still following the mouse, in a way.
I think my custom cursor will only be useful in point, and click games.
-
Sounds good.