[ create a new paste ] login | about

Link: http://codepad.org/ORj2d9ub    [ raw code | output | fork ]

iPadtutorial909 - Lua, pasted on Aug 29:
-- Kitchen Combat

-- Use this function to perform your initial setup
function setup()
 displayMode(FULLSCREEN)

--Building hp
building_blender_hp = math.random(100,500)
building_poper_hp = math.random(100,500)
building_knife_hp = 1
building_toaster_hp = math.random(100,500)

--Building attacks
weapon_seed_dmg = 30
weapon_slice_dmg = 300
weapon_blade_dmg = 100
weapon_miniToast_dmg = 50
weapon_explosion_dmg = 90

--Hp of enemies
enemy_flying_light_hp = 100
enemy_ground_candle_hp = 50
enemy_ground_cow_hp = 250

--Damage of enemies
enemy_flying_light_dmg = 100
enemy_ground_candle_dmg = 45
enemy_ground_cow_dmg = 90
k = vec2(500, 100)
EC = vec2(1000, 600)

start = 0
play = 0
help = 1
mode = start
r = false
its_on = false
match_on=0
s = 0

--Keeps hold and watches most of the things
print("Match:"..match_on)
print("ToastarHP:"..building_toaster_hp)
print("BelderHP:"..building_blender_hp)
print("PoperHP:"..building_poper_hp)
parameter.watch("match_on")
end

function draw()
if mode == start then
    background(123, 123, 148, 255)
fontSize(75)
fill(255, 133, 0, 255)
text("Kitchen", 500, 700)
fill(0, 255, 75, 255)
text("Combat", 500, 600)

fontSize(25)
fill(127, 127, 127, 255)
rect(200, 200,100,100)
fill(0)
text("Play!", 250,250)
fill(127, 127, 127, 255)
rect(600,200,100,100)
fill(0)
text("HELP!",650,250)

if CurrentTouch.x >=200 and CurrentTouch.x <=300 and CurrentTouch.y >=200 and CurrentTouch.y <=300 then
    mode = play
    r = true
    end
if CurrentTouch.x >=600 and CurrentTouch.x <=700 and CurrentTouch.y >=200 and CurrentTouch.y <=300 then
mode = help
        end
    end
   if mode == help then
background(89, 57, 31, 255)
fontSize(75)
fill(255, 0, 0, 255)
text("?", 500, 700)
fontSize(25)
textWrapWidth(1000)
fill(0, 0, 0, 255)
text("Kitchen Combat is a cartoon war game. You can use many weapons in here. Take these for example: \n popcorn,exploding apples,and much more. The possibilites are endless of your inevtory.(not really) Defete many types of enemies that are not food related. Carful of the flying bulbs! They can fly and drop mini light bulbs on your food. For ground units, use traps like maple syrup, juice, and troop beer(yes its called troops beer). A air trap is: \n Seeking seasmies. ", 500, 550)
   end
if mode == play and r == true then
background(136, 134, 134, 255)
match_on = match_on + 0.1
for i = 1,6 do
    sprite("Documents:blender", 100, 100 * i,70,70)
end
for i = 1,6 do
sprite("Documents:outlit", 300, 100 * i, 70, 70)
end
    for i = 1,6 do
    sprite("Documents:apple", 200, 100 * i, 70, 70)
    end
for i = 1,6 do
sprite("Documents:toaster", 400, 100 * i, 70, 70)
    end
for i = 1,6 do
sprite("Documents:popcorn-maker", 500, 100 * i, 70, 70)
end
for i = 1,6 do
    if EC.x <=600 then
        tint(0, 0, 0, 0)
sprite("Documents:knife", 600, 100 * i, 70, 70)
r=true
elseif EC.x >=601 then
sprite("Documents:knife", 600, 100 * i, 70, 70)
end
end
end
noTint()
local ker = "Documents:kernel"
local ex = "Tyrian Remastered:Explosion Huge"
local ex_radios = 100
local enemyLight = "Planet Cute:Star"
local enemyCow = "Planet Cute:Enemy Bug"
local t = "Documents:toast"
if match_on >49 then
its_on = true
        end
if its_on == true then
    if s == 0 then
sprite(enemyCow, EC.x, EC.y)
elseif s >=1 then
tint(0, 0, 0, 0)
sprite(enemyCow, EC.x, EC.y)
end
noTint()
EC.x = EC.x - 1
sprite("Documents:kernel",k.x,600)
k.x = k.x + 3
if k.x >=760 then
enemy_ground_cow_hp = enemy_ground_cow_hp - 30
k = vec2(500, 600)
    end

if enemy_ground_cow_hp <=0 then
s = s + 1
    end
    end
end

function touched(t)

end


Output:
1
line 5: unexpected symbol near '�'


Create a new paste based on this one


Comments: