Topic:   The Epic Maze of Scary Monsters   (Read 30759 times)


0 Members and 2 Guests are viewing this topic.

Zoo


  • GMG Extraordinaire

  • ***


  • Posts: 1686
    • My Bandcamp
The Epic Maze of Scary Monsters
« on: December 09, 2011, 06:33:21 PM »
I'm making this game called TEMSM (The Epic Maze of Scary Monsters)
And it's working pretty well. The code is on the.... um.... heavy side...
It's hard to work with, and adding another wall to the game would be hard because of that. I also want to make it so the enemy doesn't walk off the screen. Is anyone willing to look over my code and tell me how I should work with it?
http://www.mediafire.com/?k5fnvosa45p62ce
Code: [Select]
Loop movie

x1 = 205
y1 = 205
h = 1
x = 5
y = 5
SPRITE 1 x y Player.gif
SPRITE 2 105 55 Block.gif
SPRITE 3 x1 y1 Block2.gif
ON KEYDOWN
 
  sc = SPRITECOLLIDE 1 2
  sc2 = SPRITECOLLIDE 1 3
  sc3 = SPRITECOLLIDE 1 4
  IF keydown$ = "w" THEN
    IF sc = 0 THEN
      IF sc2 = 0 THEN
        y = y - 10
        SPRITE 1 x y Player.gif
      END IF
    END IF
    IF sc = 1 THEN h = h - 1
    IF sc2 = 1 THEN h = h - 1
    IF sc3 = 1 THEN
      counter = counter + 5
      SPRITE 4 0 0 n/a.gif
    END IF
  END IF
 
  IF keydown$ = "s" THEN
    IF sc = 0 THEN
      IF sc2 = 0 THEN
        y = y + 10
        SPRITE 1 x y Player.gif
        IF sc3 = 1 THEN
          counter = counter + 5
          SPRITE 4 -656 -1641 n/a.gif
        END IF
      END IF
      
      
      IF sc = 1 THEN h = h - 1
      IF sc2 = 1 THEN h = h - 1
    END IF
  END IF
 
  IF keydown$ = "a" THEN
    IF sc = 0 THEN
      IF sc2 = 0 THEN
        x = x - 10
        SPRITE 1 x y Player.gif
        IF sc3 = 1 THEN
          counter = counter + 5
          SPRITE 4 -656 -1641 n/a.gif
        END IF
      END IF
      
      IF sc = 1 THEN h = h - 1
      IF sc2 = 1 THEN h = h - 1
    END IF
  END IF
 
  IF keydown$ = "d" THEN
    IF sc = 0 THEN
      IF sc2 = 0 THEN
        x = x + 10
        SPRITE 1 x y Player.gif
        IF sc3 = 1 THEN
          counter = counter + 5
          SPRITE 4 -656 -1641 n/a.gif
        END IF
      END IF
      
      IF sc = 1 THEN h = h - 1
      IF sc2 = 1 THEN h = h - 1
    END IF
  END IF
  IF h = 0 THEN GOTOCARD 10
END KEYDOWN



ON TIMER 15
  mytimer = mytimer + 1
  IF mytimer = 2 THEN
    ai = RANDOM 1 2 3 4
    IF ai = 1 THEN x1 = x1 + 50
    IF ai = 2 THEN x1 = x1 - 50
    IF ai = 3 THEN y1 = y1 + 50
    IF ai = 4 THEN y1 = y1 - 50
    SPRITE 3 x1 y1 block2.gif
    mytimer = 0
   
    IF counter > 199 THEN GOTOCARD 4
   
  END IF
 
  mytimer2 = mytimer2 + 1
  IF mytimer2 = 25 THEN
    csX = RANDOM 626
    csY = RANDOM 327
    SPRITE 4 csX csY coin.gif
    mytimer2 = 0
  END IF
END TIMER
The main code
Kirby, your pudgy buddy from dream land, is back again on the game boy®!

Zoo


  • GMG Extraordinaire

  • ***


  • Posts: 1686
    • My Bandcamp
Re: The Epic Maze of Scary Monsters
« Reply #1 on: December 14, 2011, 03:33:23 PM »
Anyone? lol?
Kirby, your pudgy buddy from dream land, is back again on the game boy®!

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: The Epic Maze of Scary Monsters
« Reply #2 on: December 14, 2011, 03:43:56 PM »
Ah sorry Zoo. I looked at this thread and meant to give it a go but all this studying has made me forget.

I have a final in 2 hours. After I finish my final I'll check it out and see if I can help.

Circuit


  • GMG-er

  • **


  • Posts: 299

  • blast from the past
Re: The Epic Maze of Scary Monsters
« Reply #3 on: December 14, 2011, 05:38:57 PM »
Looks interesting.  It would be easier to work with if you added comments, and gave the variables more meaningful names.  But I think I understand it for the most part.

I noticed that the keydown$ sections are mostly identical, with only slight differences.  You should put the key-specific code into a SELECT CASE structure, and put the general stuff (collision detection, etc.) either before or after the SELECT CASE.  That will make it more concise, efficient, and easy to work with.
« Last Edit: December 15, 2011, 01:31:16 AM by Circuit »

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: The Epic Maze of Scary Monsters
« Reply #4 on: December 14, 2011, 09:29:05 PM »
:O I can't run GameMaker cause I'm on Lion.

GMG Kurt


  • GMG-er

  • **


  • Posts: 682

  • Sorry for being such a noob
Re: The Epic Maze of Scary Monsters
« Reply #5 on: December 14, 2011, 09:33:43 PM »
I'll look at it tomorrow. [smiley=tongue2.gif]

SO whats up is something wrong with it, or your giving us an update on your awesome new 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

Connors


  • ^ This guy is amazing.

  • ****


  • Posts: 2374

  • It's a secret to everyone...
Re: The Epic Maze of Scary Monsters
« Reply #6 on: December 14, 2011, 10:09:47 PM »
GM doesn't work on Lion either!? That means neither do the games. And Quest of Magic! Gads!
I should file a complaint. Soon they will be obsolete! :CCCC
Warning: The above post may have been modified multiple times.

"In a great game, the character must never perfectly obey the user's command"
 - Tim Rogers

http://connorspuzzles.tumblr.com/

Zoo


  • GMG Extraordinaire

  • ***


  • Posts: 1686
    • My Bandcamp
Re: The Epic Maze of Scary Monsters
« Reply #7 on: December 15, 2011, 03:24:07 PM »
I hope GM 4 will work on lion... otherwise I might have to *Shudders* use something else  [smiley=shocked2.gif] [smiley=shocked.gif]
Kirby, your pudgy buddy from dream land, is back again on the game boy®!

Connors


  • ^ This guy is amazing.

  • ****


  • Posts: 2374

  • It's a secret to everyone...
Re: The Epic Maze of Scary Monsters
« Reply #8 on: December 15, 2011, 08:41:46 PM »
You could learn SC pretty darn fast.

...Lol I said "gads".  ::)
« Last Edit: December 16, 2011, 09:56:19 AM by Connors »
Warning: The above post may have been modified multiple times.

"In a great game, the character must never perfectly obey the user's command"
 - Tim Rogers

http://connorspuzzles.tumblr.com/

Zoo


  • GMG Extraordinaire

  • ***


  • Posts: 1686
    • My Bandcamp
Re: The Epic Maze of Scary Monsters
« Reply #9 on: December 16, 2011, 03:24:41 PM »
I probably could.
Kirby, your pudgy buddy from dream land, is back again on the game boy®!

Circuit


  • GMG-er

  • **


  • Posts: 299

  • blast from the past
Re: The Epic Maze of Scary Monsters
« Reply #10 on: December 16, 2011, 04:28:19 PM »
Quote
GM doesn't work on Lion either!? That means neither do the games. And Quest of Magic! Gads!
I should file a complaint. Soon they will be obsolete! :CCCC
Years ago, Mike wrote a program that adds Carbon code to old GM games.  This made them compatible with OS X.  I wonder if it would be feasible to add x86 code to make games compatible with Lion.

Connors


  • ^ This guy is amazing.

  • ****


  • Posts: 2374

  • It's a secret to everyone...
Re: The Epic Maze of Scary Monsters
« Reply #11 on: December 16, 2011, 07:05:52 PM »
I've been wondering about that to, I remember "Carbon". It would be great if these survived longero
« Last Edit: December 16, 2011, 07:06:02 PM by Connors »
Warning: The above post may have been modified multiple times.

"In a great game, the character must never perfectly obey the user's command"
 - Tim Rogers

http://connorspuzzles.tumblr.com/

Connors


  • ^ This guy is amazing.

  • ****


  • Posts: 2374

  • It's a secret to everyone...
Re: The Epic Maze of Scary Monsters
« Reply #12 on: December 27, 2011, 10:47:26 AM »
Are sc, sc2 and sc3 for collisions only?? If you want to be able to add walls you should make a FOR loop that goes through all sprite numbers that are walls, in this case 1 through 3. It could do the same thing for any wall depending on which side you hit.
And as for things going off the screen, just say if it's off the screen reset x or y to be back on. If x is less than zero then set x to zero.
Warning: The above post may have been modified multiple times.

"In a great game, the character must never perfectly obey the user's command"
 - Tim Rogers

http://connorspuzzles.tumblr.com/

EqwanoX


  • Administrator

  • GMG Extraordinaire

  • *****


  • Posts: 1180
Re: The Epic Maze of Scary Monsters
« Reply #13 on: December 28, 2011, 06:56:22 AM »
stop what your doing and learn sc, its easier use, much faster, and theres more support for it if you needed help

Zoo


  • GMG Extraordinaire

  • ***


  • Posts: 1686
    • My Bandcamp
Re: The Epic Maze of Scary Monsters
« Reply #14 on: December 28, 2011, 10:04:31 AM »
Yes sir, Sorry sir! Right away, Sir!  :P
Kirby, your pudgy buddy from dream land, is back again on the game boy®!