Hello im a newbie and did my first game
__but now my 2nd game is coming out soon!
If you want my code:
-- EpicA
currentlevel=0
enemydmg=0
enemyhp=0
Rcob=0
Rcob2=0
m=0
topx=0
topy=0
opx=0
opy=0
hp=10
dmg=2
maxhp=10
realenemyhp=0
realenemydmg=0
defense=0
timer=0
turn=1
renemy=0
s=true
attakp=false
defp=false
hpswitch=true
m2switch=true
m3switch=true
mswitch=true
timerturna=false
iib=false
textturn=""
function setup()
displayMode(FULLSCREEN)
music("A Hero's Quest:Hero's Triumph")
end
function draw()
if(iib==true)then
if(turn==1)then
textturn="your turn"
end
if(turn==2)then
textturn="oppoment turn"
end
if(timerturna==true)then
textturn="oppoment turn"
end
if(timerturna==false)then
timer=60
end
if(timerturna==true)then
if(timer>0)then
timer = timer-1
end
end
end
print(DeltaTime)
if(iib== false)then
Rcob=Rcob+m
if(Rcob==60)then
Rcob2= math.random(1,10)
Rcob = 0
end
if(Rcob2==10)then
print("loo")
iib = true
topx = 0
topy= 0
renemy=math.random(1,3)
end
end
if(currentlevel == 0)then
background(90, 173, 230, 255)
sprite("Planet Cute:Enemy Bug",WIDTH/2,700)
sprite("Platformer Art:Battor Dead",900,300,100)
font("HelveticaNeue-BoldItalic")
fontSize(100)
textWrapWidth(800)
fill(0, 0, 0, 255)
text("EpicA",WIDTH/2,WIDTH/2-200)
font("AmericanTypewriter-Light")
fontSize(30)
textWrapWidth(800)
fill(0, 0, 0, 255)
text("Tap to start",WIDTH/2,WIDTH/2-275)
end
if(currentlevel == 1)then
if(iib== false)then
background(47, 93, 31, 255)
sprite("Planet Cute:Character Boy",WIDTH/2,WIDTH/2-50)
if( mswitch == true )then
music("Game Music One 2:Runner Blade")
mswitch = false
end
end
end
if(currentlevel == 0)then
if(CurrentTouch.state == BEGAN)then
currentlevel = currentlevel+1
end
end
if(iib==false)then
if(currentlevel==1)then
currentlevel1()
end
end
if(iib==false)then
if(CurrentTouch.state == BEGAN)then
if(CurrentTouch.y <=200)then
topy = 2.5
m=1
end
if(CurrentTouch.y >=850)then
topy = -2.5
m=1
end
if(CurrentTouch.x <=200)then
topx = 2.5
m=1
end
if(CurrentTouch.x >=850)then
topx = -2.5
m=1
end
end
if(CurrentTouch.state ==ENDED)then
topx=0
topy=0
m=0
end
end
if(iib == true)then
if(s==true)then
turn=1
s=false
end
background(0, 0, 0, 255)
fill(76, 76, 76, 255)
ellipse(700,100,10000,700)
sprite("Cargo Bot:Dialogue Box",300,300,250)
sprite("Small World:Sword",300,300,15)
sprite("Cargo Bot:Dialogue Box",1000,300,250)
sprite("Cargo Bot:Title Large Crate 2",1000,300,90)
fill(0, 0, 0, 255)
font("AmericanTypewriter-Bold")
fontSize(60)
textWrapWidth(800)
text("hp:",270,150)
text(hp,350,150)
text("dmg:",1000,150)
text(textturn,650,120)
fill(114, 31, 34, 255)
text("enemyhp:",230,900)
text(enemyhp,420,900)
end
--Battle
if(iib==true)then
if(maxhp<hp)then
hp=maxhp
end
if(enemydmg<0)then
enemydmg=0
end
if(defp==true)then
if( m3switch==true)then
enemydmg=enemydmg-1
end
defp=false
if(hp<6)then
hp =hp+1
end
end
if(m2switch==true)then
music("Game Music One 2:Jungle Rampage")
m2switch=false
end
if(turn==1)then
--attak
if(timerturna==false)then
if(CurrentTouch.state==BEGAN)then
if(CurrentTouch.y<350)then
if(CurrentTouch.y>250)then
if(CurrentTouch.x<400)then
if(CurrentTouch.x>250)then
timerturna=true
attakp=true
end
end
end
end
end
end
if(timerturna==false)then
if(CurrentTouch.state==BEGAN)then
if(CurrentTouch.x>=850)then
if(CurrentTouch.x<=1100)then
if(CurrentTouch.y>=250)then
if(CurrentTouch.y<=400)then
defp=true
timerturna=true
print("def")
end
end
end
end
end
end
end
if(timer==1)then
turn=2
timerturna=false
timer=60
end
if(turn==2)then
hp=hp-enemydmg
enemydmg = realenemydmg
if(enemyhp<=0)then
iib =false
Rcob2=0
renemy=0
hpswitch=true
enemyhp=-1000
m2switch=true
m3switch=true
music("Game Music One 2:Runner Blade")
end
turn=1
end
if(attakp==true)then
enemyhp=enemyhp-dmg
attakp=false
print("attaked")
end
if(currentlevel==1)then
if(renemy==1)then
sprite("Planet Cute:Enemy Bug",700,800)
if(hpswitch==true)then
enemydmg=1
enemyhp=3
hpswitch=false
realenemydmg=1
realenemyhp=3
end
end
if(currentlevel==1)then
if(renemy==2)then
sprite("Platformer Art:Battor Flap 1",700,800,100)
if(hpswitch==true)then
enemydmg=2
enemyhp=4
hpswitch=false
realenemydmg=2
realenemyhp=4
end
end
if(currentlevel==1)then
if(renemy==3)then
sprite("Planet Cute:Rock",700,800)
if(hpswitch==true)then
enemydmg=0
enemyhp=5
hpswitch=false
realenemydmg=0
realenemyhp=5
end
end
end
end
end
end
end
opy = 0
opx = 0
function currentlevel1()
if(iib ==false)then
sprite("Small World:House White",500+opx,902+opy,500)
sprite("Planet Cute:Character Pink Girl",700+opx,800+opy)
sprite("Small World:Tree 3",1000+opx,0+opy)
opy = opy+topy
opx = opx+topx
end
end
Here are the fotos of my game