Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411508 Posts in 69374 Topics- by 58430 Members - Latest Member: Jesse Webb

April 26, 2024, 10:50:31 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)Ticky Tacky
Pages: [1] 2 3
Print
Author Topic: Ticky Tacky  (Read 14813 times)
Farbs
Man
Level 10
*


/Farbs


View Profile WWW
« on: September 13, 2009, 07:51:22 PM »

Ticky Tacky is my new lunchtime procrastiject. I'm trying to make a TIGer Paint equivalent for programmers. Who wants to play?


With Ticky Tacky you can:
  • Write lofi flash games in your browser, using Lua
  • Connect games together to communally build a gameworld
  • Play communal lofi gameworlds

Check it out here. Note that it requires Flash 10 and may chew up obscene amounts of memory if allowed to run for more than an hour. It's functional but still pretty clunky.

Also check out a quick demo here. This demo runs two small games, both of which are hosted on this page (below and in the next post). Hit F4 during the game to switch to the editor and see the source code. If you'd like to add to this game world let me know and I'll modify one of my games to link to yours.

!!!TICKYTACKY!!!Funk Monkey Pong!!!TICKYTACKY!!!
function%20init%28%29%0Dp%20%3D%200.5%0Dx%20%3D%200%0Dy%20%3D%200%0Ddx%20%3D%2080%0Ddy%20%3D%2080%0Dif%20door%20%3D%3D%20%22pongright%22%20then%20x%20%3D%20145%20dx%20%3D%20-80%20end%0Dif%20door%20%3D%3D%20%22pongleft%22%20then%20x%20%3D%20-145%20dx%20%3D%2080%20end%0Dend%0D%0Dfunction%20update%28%20delta%20%29%0Ddelta%20%3D%20delta%20*%202%0D%0D--%20paddle%20movement%0Dp%20%3D%20p%20+%20delta%20*%20%28%20down%20-%20up%20%29%20*%20100%0Dp%20%3D%20math.max%28%20math.min%28%20p%2C%2075%20%29%2C%20-75%20%29%0D%0D--%20ball%20movement%0Doldy%20%3D%20y%0Dy%20%3D%20y%20+%20dy%20*%20delta%0Dif%20y%20%3C%20-95%20then%20y%20%3D%20-95%20dy%20%3D%20math.abs%28%20dy%20%29%20beep%28%20-12%2C%200.5%2C%20x%2C%200%20%29%20end%0Dif%20y%20%3E%2095%20then%20y%20%3D%2095%20dy%20%3D%20-math.abs%28%20dy%20%29%20beep%28%20-12%2C%200.5%2C%20x%2C%200%20%29%20end%0Dmidy%20%3D%20%28%20oldy%20+%20y%20%29%20/%202%0D%0Doldx%20%3D%20x%0Dx%20%3D%20x%20+%20dx%20*%20delta%0Dif%20dx%20%3E%200%20then%0D%20%20%20%20--%20right%20collision%0D%20%20%20%20if%20oldx%20%3C%20120%20and%20x%20%3E%3D%20120%20and%20midy%20%3E%3D%20-p%20-%2030%20and%20midy%20%3C%3D%20-p%20+%2030%20then%0D%20%20%20%20%20%20%20%20x%20%3D%20120%0D%20%20%20%20%20%20%20%20dx%20%3D%20-math.abs%28%20dx%20%29%20-%2010%0D%20%20%20%20%20%20%20%20dy%20%3D%20dy%20-%20%28%20down%20-%20up%20%29%20*%2050%0D%09%09beep%28%200%2C%201%2C%20x%2C%200%20%29%0D%09%09beep%28%2012%2C%201%2C%20x%2C%201%20%29%0D%20%20%20%20elseif%20x%20%3E%20150%20then%0D%09%09goto%28%20%22Funk%20Monkey%20Walk%22%2C%20%22Sailing%20over%20the%20fence%2C%20our%20hero%20contines%20on%20foot%22%2C%20%22walkleft%22%2C%20%22http%3A//forums.tigsource.com/index.php%3Ftopic%3D8207.0%22%20%29%0D%20%20%20%20end%0Dend%0Dif%20dx%20%3C%200%20then%0D%20%20%20%20--%20left%20collision%0D%20%20%20%20if%20oldx%20%3E%20-120%20and%20x%20%3C%3D%20-120%20and%20midy%20%3E%3D%20p%20-%2030%20and%20midy%20%3C%3D%20p%20+%2030%20then%0D%20%20%20%20%20%20%20%20x%20%3D%20-120%0D%20%20%20%20%20%20%20%20dx%20%3D%20math.abs%28%20dx%20%29%20+%2010%0D%20%20%20%20%20%20%20%20dy%20%3D%20dy%20+%28%20down%20-%20up%20%29%20*%2050%0D%09%09beep%28%200%2C%201%2C%20x%2C%200%20%29%0D%09%09beep%28%2012%2C%201%2C%20x%2C%201%20%29%0D%20%20%20%20elseif%20x%20%3C%20-150%20then%0D%09%09goto%28%20%22Funk%20Monkey%20Walk%22%2C%20%22Sailing%20over%20the%20fence%2C%20our%20hero%20contines%20on%20foot%22%2C%20%22walkright%22%2C%20%22http%3A//forums.tigsource.com/index.php%3Ftopic%3D8207.0%22%20%29%0D%20%20%20%20end%0Dend%0D%0D--%20background%0Ddraw%28%200.4%2C%200.5%2C%200.5%2C%200%2C%200%2C%20300%2C%20200%20%29%0Ddraw%28%201%2C%200%2C%201%2C%200%2C%200%2C%2010%2C%20200%20%29%0D%0D--%20paddles%0Ddraw%28%201%2C%200%2C%201%2C%20-130%2C%20p%2C%2010%2C%2050%20%29%0Ddraw%28%201%2C%200%2C%201%2C%20130%2C%20-p%2C%2010%2C%2050%20%29%0D%0D--%20ball%0Drf%20%3D%201%0Dif%20dx%20%3C%200%20then%20rf%20%3D%20-1%20end%0Ddraw%28%201%2C%200%2C%200.5%2C%20x%2C%20y%2C%2020%2C%2020%20%29%0Ddraw%28%201%2C%200%2C%201%2C%20x%20+%206%20*%20rf%2C%20y%20-%202%2C%208%2C%208%20%29%0Ddraw%28%201%2C%200%2C%200%2C%20x%20+%208%20*%20rf%2C%20y%20-%202%2C%204%2C%204%20%29%0Ddraw%28%201%2C%200%2C%200.2%2C%20x%20+%206%20*%20rf%2C%20y%20+6%2C%208%2C%203%20%29%0Dend%20%0D
!!!END!!!Funk Monkey Pong!!!END!!!

« Last Edit: September 13, 2009, 08:44:33 PM by Farbs » Logged
Farbs
Man
Level 10
*


/Farbs


View Profile WWW
« Reply #1 on: September 13, 2009, 07:59:09 PM »

This is the "walking" section of the pong game (below). See how it's a separate game? This text could be hosted anywhere, and be accessed by any Ticky Tacky game.

Play Funk Monkey Walk here:
http://www.farbs.org/tickytacky.html?title=Funk%20Monkey%20Walk&location=http%3A//forums.tigsource.com/index.php%3Ftopic%3D8207.0

!!!TICKYTACKY!!!Funk Monkey Walk!!!TICKYTACKY!!!
function%20init%28%29%0Dx%20%3D%200%0Dy%20%3D%200%0Ddx%20%3D%200%0Ddy%20%3D%200%0Dt%20%3D%200%0Ddrf%20%3D%201%0Drf%20%3D%201%0Dwcool%3D0%0Dif%20door%20%3D%3D%20%22walkleft%22%20then%20x%20%3D%20-140%20rf%20%3D%201%20drf%20%3D%201%20y%20%3D%200%20end%0Dif%20door%20%3D%3D%20%22walkright%22%20then%20x%20%3D%20140%20rf%20%3D%20-1%20drf%20%3D%20-1%20y%20%3D%200%20end%0Dend%0D%0Dfunction%20update%28%20delta%20%29%0D%09t%20%3D%20t%20+%20delta%0D%09wcool%20%3D%20wcool%20-%20delta%0D%0D%09dx%20%3D%20%28%20right%20-%20left%20%29%20*%20200.0%0D%09dy%20%3D%20dy%20+%20delta%20*%20800.0%0D%0D%09--%20jump%20limit%0D%09if%20up%20%3D%3D%200%20then%20dy%20%3D%20math.max%28%20dy%2C%20-100%20%29%20end%0D%0D%09x%20%3D%20x%20+%20dx%20*%20delta%0D%09y%20%3D%20y%20+dy%20*%20delta%0D%0D%09if%20dx%20%3C%200%20then%20drf%20%3D%20-1%20end%0D%09if%20dx%20%3E%200%20then%20drf%20%3D%201%20end%0D%09fp%20%3D0.5%20%5E%20%28%20delta%20*%2030%20%29%0D%09rf%20%3D%20rf%20*%20fp%20+%20%28%201%20-%20fp%20%29%20*%20drf%0D%0D%09--%20edge%20checks%0D%09if%20x%20%3C%20-150%20then%20goto%28%20%22Funk%20Monkey%20Pong%22%2C%20%22Tennis%20anyone%3F%22%2C%20%22pongright%22%2C%20%22http%3A//forums.tigsource.com/index.php%3Ftopic%3D8207.0%22%20%29%20end%0D%09if%20x%20%3E%20150%20then%20goto%28%20%22Funk%20Monkey%20Pong%22%2C%20%22Tennis%20anyone%3F%22%2C%20%22pongleft%22%2C%20%22http%3A//forums.tigsource.com/index.php%3Ftopic%3D8207.0%22%20%29%20end%0D%0D%09if%20y%20%3E%2080%20then%0D%09%09y%20%3D%2080%0D%09%09dy%20%3D%200%0D%09%09if%20not%28%20dx%20%3D%3D%20%200%20%29%20and%20wcool%20%3C%3D%200%20then%0D%09%09%09beep%28-12%2C0.1%2C%20x%2C0%29%0D%09%09%09wcool%3D0.2%0D%09%09end%0D%09%09if%20up%20%3D%3D%201%20then%0D%09%09%09dy%20%3D%20-300%0D%09%09%09tone%20%3D%20math.floor%28%20math.random%28%29%20*%2012%20%29%0D%09%09%09for%20i%20%3D%200%2C%204%20do%0D%09%09%09%09beep%28%20tone%2C%20%281%20-%20i%20*%200.2%29%5E2%2C%20x%2C%20i%20*%2020%20%29%0D%09%09%09%09beep%28%20tone%20+%205%2C%20%281%20-%20i%20*%200.2%29%5E2%2C%20x%2C%20i%20*%2020%20+%201%20%29%0D%09%09%09end%0D%09%09end%0D%09end%0D%0D%09draw%28%200.55+math.sin%28t*0.1%29*0.1%2C%200.5%2C%200.8%2C%200%2C%200%2C%20300%2C%20200%20%29%0D%0D%09vy%20%3D%20y%0D%09if%20%28%20not%20%28dx%20%3D%3D%200%20%29%29%20and%20dy%20%3D%3D%200%20then%20%20vy%20%3D%20vy%20-%20math.abs%28%20math.sin%28%20t%20*%2016%20%29%20%29%20*%2010%20end%0D%0D%09draw%28%201%2C%200%2C%200.5%2C%20x%2C%20vy%20-%2010%2C%2020%2C%2020%20%29%0D%09--%20draw%28%201%2C%200%2C%200.2%2C%20x%2C%20vy%20+%20100%2C%2010%2C%20200%20%29%0D%09draw%28%201%2C%200%2C%201%2C%20x%20+%206%20*%20rf%2C%20vy%20-%2012%2C%208%2C%208%20%29%0D%09draw%28%201%2C%200%2C%200%2C%20x%20+%208%20*%20rf%2C%20vy%20-%2012%2C%204%2C%204%20%29%0D%09draw%28%201%2C%200%2C%200.2%2C%20x%20+%206%20*%20rf%2C%20vy%20-%204%2C%208%2C%203%20%29%0D%0D%09draw%28%201%2C%200.9%2C%200.2%2C%200%2C%2090%2C%20300%2C%2020%20%29%0D%09draw%28%200.3%2C%200.8%2C%200.5%2C%200%2C%2085%2C%20300%2C%2012%20%29%0Dend%20%0D
!!!END!!!Funk Monkey Walk!!!END!!!

« Last Edit: September 13, 2009, 08:04:25 PM by Farbs » Logged
Gold Cray
Level 10
*****


Gold Cray


View Profile WWW
« Reply #2 on: September 13, 2009, 08:44:11 PM »

That looks pretty cool. I'll look into it more later when I'm not swamped with homework &c.
Logged
ChevyRay
Guest
« Reply #3 on: September 13, 2009, 10:38:18 PM »

Farbs, I admire your ability to come up with some of the craziest and coolest ideas.

I don't really know Lua, but I'm still interested in playing around with this.
Logged
mark
Level 7
**


not actually fat, just posing.


View Profile
« Reply #4 on: September 14, 2009, 12:10:22 AM »

So you're doing this and CPT Forever... Crazy

I can hardly juggle school and social.
Logged


I call it the KittenPunisher.

My lisp code told me to leave.
Farbs
Man
Level 10
*


/Farbs


View Profile WWW
« Reply #5 on: September 14, 2009, 12:14:52 AM »

Heh. CF still gets all my love and attention, and is effectively my daytime job. This is just a lunchtime thing.
Logged
bateleur
Level 10
*****



View Profile
« Reply #6 on: September 14, 2009, 03:39:20 AM »

As soon as the IGF deadline is passed I'd love to play with this!

For now, a quick feature suggestion:

goto( title, prompt, door, url ) should take a fifth parameter which is passed to the new game that is launched in some way. This would greatly improve the scope and would allow people to, for example, design levels for each other's games or interact with adjacent games in other interesting ways.

In fact it would even be possible for a game to include its own level designer that way (similar to the way games export at the moment). (I promise to stop short of implementing Ticky Tacky using Ticky Tacky! Grin)
Logged

Farbs
Man
Level 10
*


/Farbs


View Profile WWW
« Reply #7 on: September 14, 2009, 04:17:10 AM »

Cheers. That's pretty much what door is for - it's a string accessible to the next game as a global variable. You can stick whatever you like in there. I expect people would mostly just use it to tell the new game where the player came from, hence the name.
Logged
moi
Level 10
*****


DILF SANTA


View Profile WWW
« Reply #8 on: September 14, 2009, 05:38:22 AM »

Farbs, this is too cool. You' re a suspiciously too smart (it's a compliment eh).
I dont have time to play with this, but I'm sure someone will make something very cool with it once in a while Beer!
Logged

subsystems   subsystems   subsystems
Ina Vegt
Level 1
*


Girl Game Developer


View Profile
« Reply #9 on: September 14, 2009, 05:53:52 AM »

Okay, we can do something collab fun with this, I know we can.

I suggest that in addition to linking rooms and such, we share useful code here, to be copypasted into rooms. Stuff like a function to draw letters for simple dialogue screens.

Not familiar with lua enough to make something useful yet, sorry. I'll be learning.
Logged
nihilocrat
Level 10
*****


Full of stars.


View Profile WWW
« Reply #10 on: September 14, 2009, 06:34:10 AM »

Lua itself is pretty dead simple, it's a matter of learning whatever API you are wrapping with it.
Logged

Farbs
Man
Level 10
*


/Farbs


View Profile WWW
« Reply #11 on: September 14, 2009, 01:25:38 PM »

I kept the API insanely simple to minimise startup time and encourage creativity. All you get is a rect drawing function, a beep(), and the aforementioned goto(). Input comes from reading global variables named up, down, left, right, and fire.

This sample game's a pretty good place to get started:
Quote
function init()
   -- initialize position to middle of screen
   x = 0
   y = 0
end

function update( delta )
   -- move
   x = x + delta * ( right - left ) * 100
   y = y + delta * ( down - up ) * 100

   -- render
   draw( 1, 1, 1, x, y, 10, 10 )
end
Logged
nihilocrat
Level 10
*****


Full of stars.


View Profile WWW
« Reply #12 on: September 14, 2009, 01:57:14 PM »

Hey farbs, I just noticed something...


... what's the 'fire' key? this doesn't do anything if I try pressing stuff like spacebar, Z, X, Enter...

Code:
function init()
   -- initialize position to middle of screen
   x = 0
   y = 0
end

function update( delta )
   -- move
   x = x + delta * ( right - left ) * 100
   y = y + delta * ( down - up ) * 100

  if fire == 1 then
   draw( 0.5,1,1, x, y, 10, 10 )
  end

   -- render
   draw( 1, 1, 1, x, y, 10, 10 )
end
Logged

Farbs
Man
Level 10
*


/Farbs


View Profile WWW
« Reply #13 on: September 14, 2009, 02:07:28 PM »

Heheh. Fire key is space bar. The reason you're not seeing a blue box when you fire is that you're drawing a red box exactly over the top of it immediately afterwards Smiley

Try increasing the radius of the blue box so it can poke out the edges.
Logged
nihilocrat
Level 10
*****


Full of stars.


View Profile WWW
« Reply #14 on: September 14, 2009, 05:03:13 PM »

oh, duh.
Logged

agj
Level 10
*****



View Profile WWW
« Reply #15 on: September 16, 2009, 11:17:37 PM »

Farbs, this is a pretty amazing idea. I don't know Lua, though, but I have to learn it one of these days, really.
Logged

nyarla
Level 0
**

what


View Profile WWW
« Reply #16 on: September 17, 2009, 06:26:10 AM »

really cool idea. i made this  WTF
spill fizzly rainbow squares and let them dissolve to temporarily win.

!!!TICKYTACKY!!!A suffusion of yellow!!!TICKYTACKY!!!
--%20Startup%20code%20goes%20here%0Dfunction%20init%28%29%0D%0Dx%20%3D%200%20y%20%3D%200%20v%20%3D%2050%20w%20%3D%200%20s%20%3D%200%20%0D%0Dend%0D%0D--%20Update%20loop%20goes%20here%0Dfunction%20update%28%20delta%20%29%0D%0Dfor%20q%20%3D%201%2C%2010%2C%205%20do%0Dfor%20i%20%3D%200.0%2C%200.9%2C%200.1%20do%0Dp%20%3D%20y%20-%20x%20+%20q%20%0Dif%20left%20%3D%3D%201%20then%20y%20%3D%20y%20-%201%20end%20if%20right%20%3D%3D%201%20then%20y%20%3D%20y%20+%201%20end%20if%20up%20%3D%3D%201%20then%20x%20%3D%20x%20-%201%20end%20%20if%20down%20%3D%3D%201%20then%20x%20%3D%20x%20+%201%20end%0D%0Dif%20s%20%3E%20-1%20then%0D%0Ddraw%28i-0.3%2C1%2C1%2Ci*y%2Cx%2C50-x%2C1+q+s+5%29%0D%0Ddraw%28i+0.3%2C1%2C1%2C-y*i%2C-x%2C50-x%2C1+q+s+5%29%0Dx%20%3D%20x%20+%205%20%25%20100%20/%20v%0D%0Dy%20%3D%20y%20+%20v%20%25%20v%20/%2010%20%0D%0Dif%20s%20%3E%200%20then%0D%0Ddraw%281%2C0%2Cw%2C0%2C0%2Cs*2%2Cs*2%29%0D%0Ds%20%3D%20s%20-%201%0D%0Dend%20%0D%0Dif%20s%20%3E%20200%20then%20s%20%3D%20-1%20l%20%3D%20300%20end%0D%0Dend%0D%0Dend%0Dend%0D%0Dif%20x%20%3E%20100%20then%20x%20%3D%20-100%20s%20%3D%20s%20+%20100%20w%20%3D%200%20beep%28%20-12%2C1%2C0%2C0%29%20end%0D%0Dif%20y%20%3E%20100%20then%20y%20%3D%20-100%20s%20%3D%20s%20+%20100%20w%20%3D%201%20beep%28%2012%2C1%2C0%2C0%29%20end%0D%0Dif%20x%20%20%3C%20-100%20then%20x%20%3D%20100%20s%20%3D%20s%20+%20100%20w%20%3D%200%20beep%28%20-12%2C1%2C0%2C0%29%20end%0D%0Dif%20y%20%3C%20-100%20then%20y%20%3D%20100%20s%20%3D%20s%20+%20100%20w%20%3D%201%20beep%28%2012%2C1%2C0%2C0%29%20end%0D%0Dif%20s%20%3C%200%20then%0Ds%20%3D%20s%20-%201%0D%0Dbeep%2824%20+%20s%2C1%2C0%2C0%29%0D%0Dfor%20r%20%3D%200%2C%2020%2C%201%20do%20%0Ddraw%28l%2Cl%2C1%2Cr*x/2%2Cr*y/2%2C5-l%2C5-l%29%20%0D%0Dl%20%3D%20l%20-%200.1%0Dend%0Dend%0D%0Dend%0D
!!!END!!!A suffusion of yellow!!!END!!!

« Last Edit: September 17, 2009, 06:33:19 AM by nyarla » Logged
agj
Level 10
*****



View Profile WWW
« Reply #17 on: September 17, 2009, 09:51:31 AM »

That is trippy and great.
Logged

Massena
Level 4
****


Satisfied.


View Profile
« Reply #18 on: September 18, 2009, 01:53:44 PM »

This is nothing short of absolutely brilliant! I'll post again with some dumb stuff, for great fun.

You are down right amazing, mister Farbs.  Hand Thumbs Up Right
Logged

nyarla
Level 0
**

what


View Profile WWW
« Reply #19 on: September 19, 2009, 08:14:10 AM »

The box you type code into seems a bit buggy..

It sometimes doesn't like cut/copy/paste - pasted code won't work until you add a space or CR on the end of each line, i think..?  only sometimes!  And it starts giving error messages on code which previously worked.

I just spent an hour making a crazy driving game and then messed it up somehow cut/pasting, couldn't get it to run at all any more despite not having actually changed any code, and closed the window in drunken frustration :D

It's really fun though!

Logged
Pages: [1] 2 3
Print
Jump to:  

Theme orange-lt created by panic