Topic:   Mouse and cheese   (Read 10743 times)


0 Members and 1 Guest are viewing this topic.

Zoo


  • GMG Extraordinaire

  • ***


  • Posts: 1686
    • My Bandcamp
Mouse and cheese
« 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
Kirby, your pudgy buddy from dream land, is back again on the game boy®!

GMG Kurt


  • GMG-er

  • **


  • Posts: 682

  • Sorry for being such a noob
Re: Mouse and cheese
« Reply #1 on: March 08, 2011, 04:50:18 PM »
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
Just your average Weekend Warrior.
Yes I know I have bad spelling, it's what makes me such a good programmer!

"Old art, weather magnificent or wretched, is always the raw material of new art. The artist's job, though, is to

Zoo


  • GMG Extraordinaire

  • ***


  • Posts: 1686
    • My Bandcamp
Re: Mouse and cheese
« Reply #2 on: March 08, 2011, 04:54:23 PM »
I need loopscript for the mouse to work so it's good that this will work.
Kirby, your pudgy buddy from dream land, is back again on the game boy®!

GMG Kurt


  • GMG-er

  • **


  • Posts: 682

  • Sorry for being such a noob
Re: Mouse and cheese
« Reply #3 on: March 08, 2011, 04:56:24 PM »
Cool, if you do use this matrix will you please put my name as Kurt L. Manion,
Good luck on your game :)
Just your average Weekend Warrior.
Yes I know I have bad spelling, it's what makes me such a good programmer!

"Old art, weather magnificent or wretched, is always the raw material of new art. The artist's job, though, is to

Zoo


  • GMG Extraordinaire

  • ***


  • Posts: 1686
    • My Bandcamp
Re: Mouse and cheese
« Reply #4 on: March 08, 2011, 05:02:22 PM »
Hmm. all that seems to do is make the sprite of the mouse move choppier and laggier.
Kirby, your pudgy buddy from dream land, is back again on the game boy®!

GMG Kurt


  • GMG-er

  • **


  • Posts: 682

  • Sorry for being such a noob
Re: Mouse and cheese
« Reply #5 on: March 08, 2011, 05:22:10 PM »
Quote
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
Just your average Weekend Warrior.
Yes I know I have bad spelling, it's what makes me such a good programmer!

"Old art, weather magnificent or wretched, is always the raw material of new art. The artist's job, though, is to

Zoo


  • GMG Extraordinaire

  • ***


  • Posts: 1686
    • My Bandcamp
Re: Mouse and cheese
« Reply #6 on: March 08, 2011, 05:55:25 PM »
yeah, i'm using the custom cursor thingy. that doesn't work either, maybe I'll use the WASD for movement instead.
Kirby, your pudgy buddy from dream land, is back again on the game boy®!

GMG Kurt


  • GMG-er

  • **


  • Posts: 682

  • Sorry for being such a noob
Re: Mouse and cheese
« Reply #7 on: March 09, 2011, 02:54:29 PM »
Quote
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?
Just your average Weekend Warrior.
Yes I know I have bad spelling, it's what makes me such a good programmer!

"Old art, weather magnificent or wretched, is always the raw material of new art. The artist's job, though, is to

Zoo


  • GMG Extraordinaire

  • ***


  • Posts: 1686
    • My Bandcamp
Re: Mouse and cheese
« Reply #8 on: March 09, 2011, 08:21:28 PM »
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.
Kirby, your pudgy buddy from dream land, is back again on the game boy®!

GMG Kurt


  • GMG-er

  • **


  • Posts: 682

  • Sorry for being such a noob
Re: Mouse and cheese
« Reply #9 on: March 12, 2011, 09:15:47 AM »
Quote
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.
« Last Edit: March 12, 2011, 09:16:58 AM by KurtManion »
Just your average Weekend Warrior.
Yes I know I have bad spelling, it's what makes me such a good programmer!

"Old art, weather magnificent or wretched, is always the raw material of new art. The artist's job, though, is to

Zoo


  • GMG Extraordinaire

  • ***


  • Posts: 1686
    • My Bandcamp
Re: Mouse and cheese
« Reply #10 on: March 12, 2011, 10:40:06 AM »
Sounds good.
Kirby, your pudgy buddy from dream land, is back again on the game boy®!