-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.lua
86 lines (68 loc) · 2.98 KB
/
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
--Author :
--+-+-+-+-+-+-+-+-+-+
--|I|A|m|T|e|r|r|o|r|
--+-+-+-+-+-+-+-+-+-+
-- Street Fighter Wiki - Character Select : https://streetfighter.fandom.com/wiki/Character_Select
-- Street Fighter Wiki - Street Fighter 2 The World Warrior : https://streetfighter.fandom.com/wiki/Street_Fighter_II:_The_World_Warrior
-- Street Fighter 2 Turbo Hyper Fighting (SNES) - World of Longplays : https://www.youtube.com/watch?v=8Usyp6OBAa8
-- The Spriter Ressources - SF2 (SNES) tilesets : https://www.spriters-resource.com/snes/streetfighteriistreetfighteriiturbo/
-- The Spriter Ressources - SF2 (SNES) sounds : https://www.sounds-resource.com/snes/streetfighteriistreetfighteriiturbo/sound/34143/
-- CONFIG --------------------------------------------------------------------------------------------------------------
-- pixel art effect
love.graphics.setDefaultFilter("nearest")
-- MODULES -------------------------------------------------------------------------------------------------------------
local my_game_settings = require("game_settings")
local my_scenes = require("scenes")
local my_start_menu = require("start_menu")
local my_player_select_menu = require("player_select_menu")
local my_characters = require("characters")
local my_flags = require("flags")
local my_snd = require("snd")
-- LÖVE ----------------------------------------------------------------------------------------------------------------
function love.load()
love.window.setTitle("Street Fighter player select menu by IAmTerror")
love.window.setMode(my_game_settings.screen_width * my_game_settings.scale_factor, my_game_settings.screen_height * my_game_settings.scale_factor)
WIDTH = love.graphics.getWidth()
HEIGHT = love.graphics.getHeight()
my_start_menu.load()
my_player_select_menu.load()
my_characters.load()
my_flags.load()
end
function love.update(dt)
if my_scenes.selected == 1 then
if not my_snd.the_world_warrior:isPlaying() then
love.audio.stop()
love.audio.play(my_snd.the_world_warrior)
end
end
if my_scenes.selected == 2 then
if not my_snd.character_select:isPlaying() then
love.audio.stop()
love.audio.play(my_snd.character_select)
end
end
end
function love.draw()
if my_scenes.selected == 1 then
love.graphics.setBackgroundColor(my_start_menu.background_color)
my_start_menu.draw()
end
if my_scenes.selected == 2 then
love.graphics.setBackgroundColor(my_player_select_menu.background_color)
my_player_select_menu.draw()
my_characters.draw()
my_flags.draw()
end
end
-- CONTROLS ------------------------------------------------------------------------------------------------------------
function love.keypressed(key)
if key=="escape" then love.event.quit() end
print("key pressed : "..key)
if my_scenes.selected == 1 then
my_start_menu.start_game()
end
if my_scenes.selected == 2 then
my_characters.change()
end
end