Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

891246 Posts in 33531 Topics- by 24772 Members - Latest Member: Lumenox_Games

June 19, 2013, 09:38:05 AM
TIGSource ForumsDeveloperTechnical (Moderators: Glaiel-Gamer, ThemsAllTook)Ticky Tacky
Pages: [1] 2 3
Print
Author Topic: Ticky Tacky  (Read 9583 times)
Farbs
Man
Level 9
*



View Profile WWW Email
« 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 9
*



View Profile WWW Email
« 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
William Laub
Level 10
*****


Gold Cray


View Profile WWW Email
« 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

Digital Modular Theremin: A new KiNd of Theremin<br />C C++ Python Verilog Java VBA C# Fortran
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.

IProgramFish
View Profile Email
« 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.
OHGOD ADD ME ON STEAM!
Farbs
Man
Level 9
*



View Profile WWW Email
« 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 9
*



View Profile WWW Email
« 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
*****


i disagree


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

lelebæcülo
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 Email
« 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 9
*



View Profile WWW Email
« 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 Email
« 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 9
*



View Profile WWW Email
« 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 Email
« Reply #14 on: September 14, 2009, 05:03:13 PM »

oh, duh.
Logged

Pages: [1] 2 3
Print
Jump to:  

Theme orange-lt created by panic