repl.it
@derpdizzzzy/

Actual v uper-1

Love2D

an homage to japenese throw em ups

fork
loading
Files
  • main.lua
  • Pyramid do
  • water
  • zen
  • 0enemies.lua
  • 0manual.txt
  • 13897AA6-7BC0-4811-B293-53DD4B6D4EC5.png
  • 189C6823-6505-4753-8327-11EA35861893.png
  • 23A03C54-231B-46F8-9804-9499407E3C7E.png
  • 27703911-2B6F-4E48-906C-B26850E752EE.png
  • 2F130A8A-195C-47F1-96A7-51FD11174B1A.png
  • 32bitspike.png
  • 4785685B-B18D-4230-A915-76A5AD657691.png
  • 7777654321dog.png
  • 7777654321dogger.png
  • 7777654321dogr.png
  • 8bitsoundtrack.m4a
  • 8bitsoundtrack.mp3
  • 8bitsoundtrack.ogg
  • 9A1A0B0B-BC25-4816-B126-DA0B20A91042.png
  • 9C332278-D1AE-49C9-A8F4-65D61A4A7D2D.png
  • 9E19E742-DD84-4C6C-914E-B6C6AC61767F.png
  • A vote.png
  • Abstract.png
  • AC5F56D3-1B47-4E0F-99DF-5C0EFCFE94E9.png
  • Ball enemies.png
  • Beams.png
  • Boss1.png
  • Bossfights.lua
  • C6B5EFFF-4E0A-4CCD-8DE2-6E43EFA7BA92.png
  • Cave.png
  • Circle attack.png
  • Circle.png
  • Circles.png
  • Derp.txt
  • Desert.png
  • Deserthilla.png
  • Diamond mosquito.png
  • E7874204-752F-4401-9D15-DF3201A7F447.png
  • Enemie functions.lua
  • Eval back.png
  • Fall spikes.png
  • H1.png
  • H2.png
  • H3.png
  • H4.png
  • H5.png
  • H6.png
  • H7.png
  • Honeydog.lua
  • Ice cream mine .png
  • Level west store.png
  • Littlecircles.png
  • Mountain.png
  • Mrcoral.png
  • Mrwestghost.png
  • Needle.png
  • Needles.png
  • nohup.out
  • Ohman.png
  • Ohyeah.png
  • Ok this.png
  • Oklahoma.png
  • Parallax dude 2.png
  • Parallax dude.png
  • Person.png
  • Putplegord.png
  • Quicksand .png
  • Resourcesforenemiesandbackgrounds.lua
  • Rocket cacti.png
  • Rocketcurcles.png
  • Royircled.png
  • Savedata.lua
  • Square.png
  • Talkies.lua
  • Text.png
  • The evil blue cartridge .png
  • Throwmagic.png
  • Tree.png
  • Treebosdy.png
  • Waller.png
  • Walls.png
  • Watermelonandbread.png
  • West doll.png
  • West uper.png
  • Whatslap.png
  • Z1.png
  • Z10.png
  • Z11.png
  • Z12.png
  • Z2.png
  • Z3.png
  • Z4.png
  • Z5.png
  • Z6.png
  • Z7.png
  • Z8.png
  • Z9.png
main.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
local condition = {}
local cors1 = {}
local cors2 = {}
local cor_rage = {}
print("warning:read 0manual.txt before playing the game")
local activecor
local currentcor = 1
local cors = {}
local Talkies = require("Talkies")
local frames = {}
local waterframes = {}
local activeframe
local currentframe = 1
local currentWaterframe = 1
local activeWaterframe
local koble = love.graphics
local rexy = love.window
local Ana = love.keyboard
local obi wan = love.filesystem
local fps = 60
local elsapedTime = 0
local music
local volume = 0.5
local Ohswims = {}
local ohihaveabeach
local whatfly
local CWF = currentWaterframe
local opens = {}
local currentopen = 1
local activeopen
require("Honeydog")
require("Resourcesforenemiesandbackgrounds")
function love.load()
local condition = {cors1.health == 0} -- Here
music = love.audio.newSource( "8bitsoundtrack.ogg", "static" )
generalImage = koble.newImage("7777654321dogr.png")
frames[1] = koble.newQuad(0, 0, 24, 24, generalImage:getDimensions())
frames[2] = koble.newQuad(24, 0, 24, 24, generalImage:getDimensions())
frames[3] = koble.newQuad(48, 0, 24, 24, generalImage:getDimensions())
frames[4] = koble.newQuad(72, 0, 24, 24, generalImage:getDimensions())
frames[5] = koble.newQuad(96, 0, 24, 24, generalImage:getDimensions())
frames[6] = koble.newQuad(120, 0, 24, 24, generalImage:getDimensions())
frames[7] = koble.newQuad(144, 0, 24, 24, generalImage:getDimensions())
frames[8] = koble.newQuad(168, 0, 24, 24, generalImage:getDimensions())
frames[9] = koble.newQuad(192, 0, 24, 24, generalImage:getDimensions())
frames[10] = koble.newQuad(216, 0, 24, 24, generalImage:getDimensions())
frames[11] = koble.newQuad(240, 0, 24, 24, generalImage:getDimensions())
frames[12] = koble.newQuad(264, 0, 24, 24, generalImage:getDimensions())
frames[13] = koble.newQuad(288, 0, 24, 24, generalImage:getDimensions())
frames[14] = koble.newQuad(312, 0, 24, 24, generalImage:getDimensions())
frames[15] = koble.newQuad(336, 0, 24, 24, generalImage:getDimensions())
frames[16] = koble.newQuad(360, 0, 24, 24, generalImage:getDimensions())
frames[17] = koble.newQuad(384, 0, 24, 24, generalImage:getDimensions())
watermelonImage = koble.newImage("water/Watermelon.png")
duckfarts = koble.newImage("Cave.png")
camelabuse = koble.newImage("Desert.png")
waterframes = {}
for i=1,7 do
    table.insert(waterframes, koble.newImage("H".. i .. ".png"))
end
itsuckstomatoes = koble.newImage("Mountain.png")
thesedarnsnowboardparts = koble.newImage("Whatslap.png")
theoakImage = koble.newImage("Ohman.png")
therealImage = koble.newImage("Oklahoma.png")
minedude = koble.newImage("Parallax dude 2.png")
rexy.setMode(512, 512)
rexy.setTitle("v uper")
player = {xpos = 0, ypos = 256, width = 24, height = 24, health = 1, speed = 240, img = generalImage}
activeframe = frames[currentframe]
watermelons = {}
canFire = false
watermelonTimermax = 0.1
watermelonstartspeed = 100
watermelonmaxspeed = 900
watermelonspeed = watermelonstartspeed
coralImage = koble.newImage("zen/5Mr.Coral Vibrant.png")
opens[1] = koble.newQuad(0, 0, 24, 24, coralImage:getDimensions())
opens[2] = koble.newQuad(24, 0, 24, 24, coralImage:getDimensions())
opens[3] = koble.newQuad(48, 0, 24, 24, coralImage:getDimensions())
opens[4] = koble.newQuad(72, 0, 24, 24, coralImage:getDimensions())
opens[5] = koble.newQuad(96, 0, 24, 24, coralImage:getDimensions())
opens[6] = koble.newQuad(120, 0, 24, 24, coralImage:getDimensions())
opens[7] = koble.newQuad(144, 0, 24, 24, coralImage:getDimensions())
opens[8] = koble.newQuad(168, 0, 24, 24, coralImage:getDimensions())
opens[9] = koble.newQuad(192, 0, 24, 24, coralImage:getDimensions())
opens[10] = koble.newQuad(216, 0, 24, 24, coralImage:getDimensions())
opens[11] = koble.newQuad(240, 0, 24, 24, coralImage:getDimensions())
opens[12] = koble.newQuad(264, 0, 24, 24, coralImage:getDimensions())
opens[13] = koble.newQuad(288, 0, 24, 24, coralImage:getDimensions())
activeopen = opens[currentopen]
FoodImage = koble.newImage("zen/6Food.png")
bread = koble.newQuad(0, 2, 8, 4, FoodImage:getDimensions())
meat = koble.newQuad(8, 2, 6, 6, FoodImage:getDimensions())
blueball = koble.newQuad(16, 3, 4, 3, FoodImage:getDimensions())
ohves = koble.newQuad(24, 1, 6, 6, FoodImage:getDimensions())
blueberd= koble.newQuad(32, 2, 5, 4, FoodImage:getDimensions())
spawn = koble.newQuad(40, 2, 8, 5, FoodImage:getDimensions())
cors1 = {x = 256, y = 256, bread, health = 10, img = coralImage}
cors2 = {x = 256, y = 258, bread, health = 10, img = coralImage}

activecor = cors[currentcor]
end
function love.update(dt)
 updatePlayer(dt)
 updatewatermelons(dt)
 updateCor(cors, dt)
 updatebread(dt)
 currentWaterframe = currentWaterframe + 10 * dt
 if currentWaterframe >= 8 then
    currentWaterframe = 1
 end
 Talkies.update(dt)
 CheckMe()
end 

function love.keypressed(key) -- Talkies
  if key == "space" then Talkies.onAction()
  elseif key == "m" then Talkies.nextOption()
  elseif key == "n" then Talkies.prevOption()

  end
end

function updatePlayer(dt)
  down = Ana.isDown("s")
  up = Ana.isDown("w")
  left = Ana.isDown("a")
  right = Ana.isDown("d")
  
  speed = player.speed
  if((down or up) and (left and right)) then
    speed = speed / math.sqrt(2)
    print("Finally, you got the movement down")
  end
  
  if down and player.ypos<koble.getHeight()-player.height then
    player.ypos = player.ypos + dt * speed
    print("DOWN!")
  elseif up and player.ypos>0 then 
    player.ypos = player.ypos - dt * speed
    print("UP!")
  end
  
  if right and player.xpos<koble.getWidth()-player.width then
    player.xpos = player.xpos + dt * speed
    print("RIGHT!")
  elseif left and player.xpos>0 then
    player.xpos = player.xpos - dt * speed
    print("LEFT!")
  end

  if Ana.isDown("j") then
     print("Throwing watermelons")
      if (currentframe < 14) then
        currentframe = currentframe + 1
        canFire = true
      else
      currentframe = 1
      end
      activeframe= frames[currentframe]
      elsapedTime = 0
      end
     watermelonspeed = watermelonstartspeed
     if(down) then
      watermelonspeed = watermelonspeed + player.speed/2
     elseif(up) then
      watermelonspeed = watermelonspeed - player.speed/2
     end
     SpawnWatermelon(player.xpos + player.width, player.ypos + player.height/2, watermelonstartspeed, success)
     music:setVolume(0.7)
     success = music:play()
  end

  
function updatewatermelons(dt)
  for index, watermelon in ipairs(watermelons) do
     watermelon.xpos = watermelon.xpos + watermelon.speed * dt
      if watermelon.speed < watermelonmaxspeed then
       watermelon.speed = watermelon.speed + dt * 100
      end
      if watermelon.xpos > koble.getWidth() then
        table.remove(watermelons, index)
      end
  end
end   
    


function SpawnWatermelon(x, y, speed)
  if canFire then
   watermelon = {xpos = x, ypos = y, width = 7, height = 6, speed = speed, img = watermelonImage, watermelonTimermax = 300}
   table.insert(watermelons, watermelon)
  
   canFire = false
  end
end

function updateCor(cors, dt)

end
function updatebread(dt)

end


function love.draw()
   local condition = {cors1.health == 0}
   background = koble.draw(theoakImage)
   koble.draw(coralImage, activeopen, cors1.x, cors1.y, 0, 2, 2)
   if condition then
   koble.draw(coralImage, activeopen, cors2.x, cors2.y, 0, 2, 2)
   end
   koble.draw(player.img, activeframe, player.xpos, player.ypos, 0, 2, 2)
   for index, watermelon in ipairs(watermelons)do
      koble.draw(watermelon.img, watermelon.xpos, watermelon.ypos)
   end
   Talkies.draw()
end
function iamakittycat()
player = {xpos = 0, ypos = 256, width = 24, height = 24, speed = 240, img = generalImage}
watermelons = {}
cors = {}
local currentcor
canFire = true
watermelonspeed = watermelonstartspeedj
watermelonTimermax = 0.1
local condition = {cors1.health < 0}

Parallaxdudeposition = 0
Parallaxdude2position = 0
Parallaxdude3position = 0

music:setVolume(0.7)
success = music:play()

end

function intersects(rect1, rect2)
  if rect1.xPos < rect2.xPos and rect1.xPos + rect1.width > rect2.xPos and rect1.yPos < rect2.yPos and rect1.yPos + rect1.height > rect2.yPos then
    return true
  else
    return false
  end
end

function CheckMe()
  for index, watermelon in ipairs(watermelons) do
     if intersects(cors1, watermelon) then -- This is to damage the enemie
        table.remove(watermelons, index)
        cors1.health = cors1.health - 1
        print("You throw was a success")
        break
     end
  end
end
?