2013-07-01 15:25:41 +02:00
|
|
|
// Copyright 2013 Hajime Hoshi
|
|
|
|
//
|
|
|
|
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
// of this software and associated documentation files (the "Software"), to deal
|
|
|
|
// in the Software without restriction, including without limitation the rights
|
|
|
|
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
// copies of the Software, and to permit persons to whom the Software is
|
|
|
|
// furnished to do so, subject to the following conditions:
|
|
|
|
//
|
|
|
|
// The above copyright notice and this permission notice shall be included in
|
|
|
|
// all copies or substantial portions of the Software.
|
|
|
|
//
|
|
|
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
|
// SOFTWARE.
|
|
|
|
|
2013-06-18 17:48:41 +02:00
|
|
|
package ebiten
|
|
|
|
|
|
|
|
import (
|
2013-06-20 16:29:51 +02:00
|
|
|
"github.com/hajimehoshi/go.ebiten/graphics"
|
2013-06-18 17:48:41 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
type Game interface {
|
2013-06-21 16:16:52 +02:00
|
|
|
ScreenWidth() int
|
|
|
|
ScreenHeight() int
|
2013-06-23 15:38:41 +02:00
|
|
|
Fps() int
|
2013-06-19 16:08:24 +02:00
|
|
|
Init(tf graphics.TextureFactory)
|
2013-07-05 14:02:17 +02:00
|
|
|
Update(context GameContext)
|
|
|
|
Draw(context graphics.Context)
|
2013-06-18 17:48:41 +02:00
|
|
|
}
|
|
|
|
|
2013-07-05 14:02:17 +02:00
|
|
|
type GameContext interface {
|
|
|
|
InputState() InputState
|
2013-07-16 18:42:53 +02:00
|
|
|
Terminate()
|
2013-06-19 02:36:57 +02:00
|
|
|
}
|
|
|
|
|
2013-06-25 03:27:32 +02:00
|
|
|
type InputState struct {
|
2013-07-04 16:57:53 +02:00
|
|
|
X int
|
|
|
|
Y int
|
2013-06-25 03:27:32 +02:00
|
|
|
}
|