Jump to content




[1.48] YellowSquare Game

game computer

15 replies to this topic

#1 mrSLIMEguy

  • Members
  • 54 posts
  • LocationMelbourne

Posted 14 January 2013 - 06:44 PM

YellowSquare is a small game I made in 7-14 minutes. You must click the yellow square to get points. If you miss, you get game over. :(

Hearing that, you may think that this game is super duper easy. But the thing is that when you click a square, it doesn't go away. Another square gets generated somewhere else... But the square you clicked stays. Also, a square can spawn on another square, therefore making it hard to figure out where to click.

Controls:
  • Q to exit
  • Left click to click the squares
Note: This game requires an advanced computer. If you use a normal computer, the program won't work.

Screenshots
Spoiler

To download, type pastebin get NmRjTJLn yellowsquare

Enjoy my little game!

#2 crazyguymgd

  • Members
  • 139 posts
  • LocationUSA

Posted 14 January 2013 - 06:50 PM

Nice job! Suggestions:
Add mouse click to the any key to start, since the mouse is what you use to play the game.
Reset the background color to black before you clear the screen. I don't like it leaving my screen yellow :)

Also, when I got up to 39 points, it must have put a new square over an old one, so there was really no way of knowing where to click. Now I don't even want to try to beat my high score because odds are, it'll just screw me again :P

#3 mrSLIMEguy

  • Members
  • 54 posts
  • LocationMelbourne

Posted 14 January 2013 - 07:35 PM

 crazyguymgd, on 14 January 2013 - 06:50 PM, said:

Nice job! Suggestions:
Add mouse click to the any key to start, since the mouse is what you use to play the game.
Reset the background color to black before you clear the screen. I don't like it leaving my screen yellow :)

Also, when I got up to 39 points, it must have put a new square over an old one, so there was really no way of knowing where to click. Now I don't even want to try to beat my high score because odds are, it'll just screw me again :P

Well, this was just a little experement... AND the first "program" i posted. All my other topics can be found in the Ask a Pro section. E]:] <-- random bunny

* goes to play on a CTF or a MCTF2 server*

#4 RunasSudo-AWOLindefinitely

  • Signature Abuser
  • 249 posts
  • Location/dev/earth1aus5

Posted 14 January 2013 - 08:47 PM

Did you implement that feature because you accidentally forgot a term.clear? :P

#5 remiX

  • Members
  • 2,076 posts
  • LocationSouth Africa

Posted 15 January 2013 - 01:43 AM

 crazyguymgd, on 14 January 2013 - 06:50 PM, said:

Also, when I got up to 39 points, it must have put a new square over an old one, so there was really no way of knowing where to click. Now I don't even want to try to beat my high score because odds are, it'll just screw me again :P

Yeah that happened to me too, I was like: "Nooo what to click?!"

I'd suggest that each time it adds a square, add it to a table and before getting random co-ordinates, check if they have already been used or something

#6 mrSLIMEguy

  • Members
  • 54 posts
  • LocationMelbourne

Posted 16 January 2013 - 09:11 PM

 remiX, on 15 January 2013 - 01:43 AM, said:

 crazyguymgd, on 14 January 2013 - 06:50 PM, said:

Also, when I got up to 39 points, it must have put a new square over an old one, so there was really no way of knowing where to click. Now I don't even want to try to beat my high score because odds are, it'll just screw me again :P

Yeah that happened to me too, I was like: "Nooo what to click?!"

I'd suggest that each time it adds a square, add it to a table and before getting random co-ordinates, check if they have already been used or something
Well i tried, but i couldnt get it to work.... :P

#7 RunasSudo-AWOLindefinitely

  • Signature Abuser
  • 249 posts
  • Location/dev/earth1aus5

Posted 16 January 2013 - 09:24 PM

 mrSLIMEguy, on 16 January 2013 - 09:11 PM, said:

Well i tried, but i couldnt get it to work.... :P/>/>
table.insert(tableOfOldSquares, {newSquareX, newSquareY})

-- Later (in a generate-square-coordinate fuction)

while true do
  -- Generate newSquareX, newSquareY
  for i = 1, #tableOfOldSquares do
    local oldPos = tableOfOldSquares[i]
    if oldPos[1] ~= newSquareX or oldPos[2] ~= newSquareY
      return newSquareX, newSquareY
    end
  end
end
It just keeps generating squares until one of them is different. You might run into problems when the board is full though.

#8 TheOutcast5

  • Members
  • 104 posts
  • LocationKonoha - Hidden Leaf Village

Posted 16 January 2013 - 09:35 PM

 RunasSudo, on 16 January 2013 - 09:24 PM, said:

It just keeps generating squares until one of them is different. You might run into problems when the board is full though.
Could always clear the screen and make waves or something

#9 crazyguymgd

  • Members
  • 139 posts
  • LocationUSA

Posted 16 January 2013 - 10:40 PM

 RunasSudo, on 16 January 2013 - 09:24 PM, said:

 mrSLIMEguy, on 16 January 2013 - 09:11 PM, said:

Well i tried, but i couldnt get it to work.... :P/>/>
table.insert(tableOfOldSquares, {newSquareX, newSquareY})

-- Later (in a generate-square-coordinate fuction)

while true do
  -- Generate newSquareX, newSquareY
  for i = 1, #tableOfOldSquares do
	local oldPos = tableOfOldSquares[i]
	if oldPos[1] ~= newSquareX or oldPos[2] ~= newSquareY
	  return newSquareX, newSquareY
	end
  end
end
It just keeps generating squares until one of them is different. You might run into problems when the board is full though.

Exactly what I wanted. New pastebin to try that part out?

#10 Skullblade

  • Members
  • 470 posts
  • LocationThe Big Apple, NY

Posted 17 January 2013 - 03:37 AM

You could have the square turn red(or any color) when it hits another yellow square then all the squares after that are red etc etc.

#11 remiX

  • Members
  • 2,076 posts
  • LocationSouth Africa

Posted 17 January 2013 - 09:00 AM

 Skullblade, on 17 January 2013 - 03:37 AM, said:

You could have the square turn red(or any color) when it hits another yellow square then all the squares after that are red etc etc.

I think that will defeat the purpose of that game. They're all yellow so you'll struggle to see which one is the new one that just popped up and it makes it hard when a lot of them on the screen...

#12 Skullblade

  • Members
  • 470 posts
  • LocationThe Big Apple, NY

Posted 17 January 2013 - 09:21 AM

yeah i guess your right but its more then hard when you cant tell what is new...

#13 RunasSudo-AWOLindefinitely

  • Signature Abuser
  • 249 posts
  • Location/dev/earth1aus5

Posted 17 January 2013 - 01:21 PM

You could make the square change colour if (and only if) it generates on top of an existing square. That would retain the "hardness" of the game while still keeping it playable.

#14 Skullblade

  • Members
  • 470 posts
  • LocationThe Big Apple, NY

Posted 17 January 2013 - 01:28 PM

yeah thats what i was thinking

#15 Ki7654

  • Members
  • 5 posts

Posted 11 November 2013 - 04:48 AM

I reckon that the "Term.Clear" is not needed. This game fools you!

EDIT: I'm pretty sure that mrSLIMEguy noticed, but there is a glitch at the very end where the screen turns yellow. I don't know if that was on purpose, but it annoyed me so I put term.setBackgroundColor( colors.black )just after line 38 to fix the problem. This game is still awesome though!

Edited by Ki7654, 11 November 2013 - 05:02 AM.


#16 biggest yikes

  • Members
  • 573 posts

Posted 15 December 2013 - 03:24 PM

I edited the yellowsquare code to fix many of the bugs found.
You can use this if you want, it's now yours :)
http://pastebin.com/8MzKVB3E

EDIT: Such as the overlapping one, I made those ones red

Edited by minimite, 15 December 2013 - 03:25 PM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users