Compare commits
2 Commits
2b33f88594
...
1409f9ebe7
Author | SHA1 | Date | |
---|---|---|---|
1409f9ebe7 | |||
5f00790856 |
11
Makefile
11
Makefile
|
@ -1,11 +1,4 @@
|
||||||
PLAYDATE_SDK_PATH := ~/playdate
|
|
||||||
GAME := Crong
|
|
||||||
|
|
||||||
all: build
|
all: build
|
||||||
|
|
||||||
build: clean
|
build:
|
||||||
mkdir -p build
|
make -C src/
|
||||||
cd src && PLAYDATE_SDK_PATH=$(PLAYDATE_SDK_PATH) $(PLAYDATE_SDK_PATH)/bin/pdc -k main.lua ../$(GAME).pdx
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -rf $(GAME).pdx
|
|
||||||
|
|
24
license.md
Normal file
24
license.md
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
Copyright 2023 Anna Rose Wiggins
|
||||||
|
|
||||||
|
⚠️ WARNING! ⚠️
|
||||||
|
☢️ 😱 DO NOT USE THIS PROGRAM. 😱 ☢️
|
||||||
|
This program is not a program of honor.
|
||||||
|
|
||||||
|
No highly esteemed function is executed here.
|
||||||
|
|
||||||
|
What is here is dangerous and repulsive to us.
|
||||||
|
|
||||||
|
The danger is still present, in your time, as it was in ours,
|
||||||
|
without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
|
||||||
|
This program is best shunned and left unused (but it is free software,
|
||||||
|
and you are welcome to redistribute it under certain conditions).
|
||||||
|
😱 ☢️ DO NOT USE THIS PROGRAM. ☢️ 😱
|
||||||
|
|
||||||
|
This program is licensed under the Sandia Message Public License,
|
||||||
|
sublicense Do What The Fuck You Want To Public License, Version 2.0.
|
||||||
|
This may be abbreviated as sandia-wtfpl.
|
||||||
|
You may obtain a copy of the License(s) at
|
||||||
|
https://github.com/cdanis/sandia-public-license/blob/main/LICENSE.md and
|
||||||
|
http://www.wtfpl.net/txt/copying/
|
|
@ -5,3 +5,5 @@ This is an extremely simple game for the (Playdate)[https://play.date] handheld
|
||||||
This is, of course, a completely novel idea and is dissimilar from any other game ever made.
|
This is, of course, a completely novel idea and is dissimilar from any other game ever made.
|
||||||
|
|
||||||
It was written as an excuse to learn the Playdate SDK, and is made available here in case it serves as a useful tool for basic object-oriented development in Playdate's LUA library.
|
It was written as an excuse to learn the Playdate SDK, and is made available here in case it serves as a useful tool for basic object-oriented development in Playdate's LUA library.
|
||||||
|
|
||||||
|
This is a very basic Playdate game. It has no sound, no launcher card, and an extremely minimal interface. It was written as a programming exercise, so it's not likely to get any of those. If you get a hair up your ass and want to contribute a pull request, feel free.
|
||||||
|
|
10
src/Makefile
Normal file
10
src/Makefile
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
PLAYDATE_SDK_PATH := ~/playdate
|
||||||
|
GAME := Crong
|
||||||
|
|
||||||
|
all: build
|
||||||
|
|
||||||
|
build: clean
|
||||||
|
PLAYDATE_SDK_PATH=$(PLAYDATE_SDK_PATH) $(PLAYDATE_SDK_PATH)/bin/pdc -k main.lua ../$(GAME).pdx
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -rf ../$(GAME).pdx
|
24
src/ball.lua
24
src/ball.lua
|
@ -1,12 +1,12 @@
|
||||||
import "pixie"
|
import "pixie"
|
||||||
|
|
||||||
class("Ball").extends(Pixie)
|
class("Ball", {
|
||||||
|
direction = {x=-1, y=1},
|
||||||
|
speed = 3,
|
||||||
|
}).extends(Pixie)
|
||||||
|
|
||||||
function Ball:init(width, height, color, x, y)
|
function Ball:init(width, height, color, x, y)
|
||||||
Ball.super.init(self, width, height, color, x, y)
|
Ball.super.init(self, width, height, color, x, y)
|
||||||
self.dirX = -1
|
|
||||||
self.dirY = 1
|
|
||||||
self.speed = 3
|
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -15,23 +15,23 @@ function Ball:levelUp()
|
||||||
end
|
end
|
||||||
|
|
||||||
function Ball:move()
|
function Ball:move()
|
||||||
self:moveBy(self.dirX * self.speed,
|
self:moveBy(self.direction.x * self.speed,
|
||||||
self.dirY * self.speed)
|
self.direction.y * self.speed)
|
||||||
end
|
end
|
||||||
|
|
||||||
function Ball:setDirection(x, y)
|
function Ball:setDirection(x, y)
|
||||||
x = x or self.dirX
|
x = x or self.direction.x
|
||||||
y = y or self.dirY
|
y = y or self.direction.y
|
||||||
self.dirX = x
|
self.direction.x = x
|
||||||
self.dirY = y
|
self.direction.y = y
|
||||||
end
|
end
|
||||||
|
|
||||||
function Ball:_normalizePosition()
|
function Ball:_normalizePosition()
|
||||||
local changeVector = Ball.super._normalizePosition(self)
|
local changeVector = Ball.super._normalizePosition(self)
|
||||||
if changeVector[1] ~= 0 then
|
if changeVector[1] ~= 0 then
|
||||||
self.dirX = changeVector[1]
|
self.direction.x = changeVector[1]
|
||||||
end
|
end
|
||||||
if changeVector[2] ~= 0 then
|
if changeVector[2] ~= 0 then
|
||||||
self.dirY = changeVector[2]
|
self.direction.y = changeVector[2]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user