Pokemon

Feel free to showcase your own projects!
Post Reply
User avatar
Lawnboy
Posts: 836
Joined: 03 Feb 2012, 02:24

Post » 07 May 2012, 02:56

Before you get all excited and shit, let me explain. So I was trying to understand OOP one day, and the one thing OOP reminded me of pokemon. So that got me thinking: What if I made a pokemon-esque game where players can create their own pokemon through simple, defined classes? So now I'm making that! I'll give you and example that I have right now. Though I don't have fighting down yet, so yeah... Kinda rough right now.

Code: Select all

Vagikarp=BasePoke:new(100,fap,"Vagikarp",true,false,1,false)--"Sorry, you're a failure as a human, here, take this vagicarp"-camewel
function Vagikarp:draw()--Draws Vagikarp.  For creating custom pokemon, follow Vagikarp's lead.
	if self.user==true then
		love.graphics.print(self.name,0,0)
		love.graphics.print(self.hp,0,11)
		love.graphics.print('lvl:'..self.level,60,0)
	end
	if self.enemy==true then
		love.graphics.print(self.name,100,0)
		love.graphics.print(self.hp,100,11)
		love.graphics.print('lvl:'..self.level,150,0)
	end
end
function Vagikarp:levelup()--LEVELUP
	if self.user==true and user.win==true then
		self.level=self.level+1
	end
	if self.enemy==true and enemy.win==true then
		self.level=self.level+1
	end
end
function Vagikarp:faint()
	self.hp=100
	if self.user==true then
		user.lose=true
	end
	if self.user==false then
		user.win=true
	end
end

User avatar
idiot9.0
Posts: 1707
Joined: 09 Mar 2012, 10:28
Contact:

Post » 07 May 2012, 03:16

This seems like a pretty neat idea. I'd like to hear your plans for battle, as soon as you come up with some.

User avatar
Lawnboy
Posts: 836
Joined: 03 Feb 2012, 02:24

Post » 07 May 2012, 03:20

idiot9.0 wrote:This seems like a pretty neat idea. I'd like to hear your plans for battle, as soon as you come up with some.
Well two turns are alternating, so each turn one gets to use his attack. For Vagikarp, his attack is fap.

Camewel
Posts: 2996
Joined: 02 Feb 2012, 21:32

Post » 07 May 2012, 03:47

Code: Select all

--"Sorry, you're a failure as a human, here, take this vagicarp"-camewel
That IRC was the best.

User avatar
Lawnboy
Posts: 836
Joined: 03 Feb 2012, 02:24

Post » 07 May 2012, 05:05

the other default pokemon is Twattle

User avatar
trosh
Posts: 1594
Joined: 03 Feb 2012, 08:36

Post » 07 May 2012, 22:23

can squirt water and play forum games

User avatar
rokit
Posts: 2095
Joined: 03 Feb 2012, 00:47

Post » 08 May 2012, 20:10

trosh wrote:can squirt water and play forum games
lol

User avatar
Pyrosaur
Posts: 769
Joined: 03 Feb 2012, 00:15
Contact:

Post » 08 May 2012, 20:15

trosh wtf did you do

User avatar
Lawnboy
Posts: 836
Joined: 03 Feb 2012, 02:24

Post » 08 May 2012, 21:30

rokit boy wrote:
trosh wrote:can squirt water and play forum games
lol
How's the fighting system, buddeh?

User avatar
rokit
Posts: 2095
Joined: 03 Feb 2012, 00:47

Post » 08 May 2012, 21:41

LawnboyInAJar wrote:
rokit boy wrote:
trosh wrote:can squirt water and play forum games
lol
How's the fighting system, buddeh?
selections
FIGHT BAG POKEMON
ONLY IF Fight is true.
I had a thing that made da pokimons fight but my laptop is crap it doesn't tell me when it's low battery and BOOM!

User avatar
Lawnboy
Posts: 836
Joined: 03 Feb 2012, 02:24

Post » 08 May 2012, 21:44

rokit boy wrote:
LawnboyInAJar wrote:
rokit boy wrote: lol
How's the fighting system, buddeh?
selections
FIGHT BAG POKEMON
ONLY IF Fight is true.
I had a thing that made da pokimons fight but my laptop is crap it doesn't tell me when it's low battery and BOOM!
Just send me whatever you have, when you can.

User avatar
Lawnboy
Posts: 836
Joined: 03 Feb 2012, 02:24

Post » 10 May 2012, 02:03

Excuse this double post. But I finally got a bad version done.
And for making custom pokemon(at the moment, I have yet to make a good customization system), behold Vagikarp.

Code: Select all

Vagikarp=BasePoke:new(100,10,"Vagikarp",true,false,1,false,'fap')
function Vagikarp:draw()
	if self.user==true then
		love.graphics.print(self.name,0,0)
		love.graphics.print(self.hp,0,11)
		love.graphics.print('lvl:'..self.level,60,0)
	end
	if self.enemy==true then
		love.graphics.print(self.name,100,0)
		love.graphics.print(self.hp,100,11)
		love.graphics.print('lvl:'..self.level,150,0)
	end
end
function Vagikarp:fight()
	if fight==true then
		if self.user==true then
		user.attackname=self.attackname--This means that the player's attack=Vagikarp's attack
			if enemy.attacking==true then 
				self.hp=self.hp-enemy.attack
			end
		end
	end
	if self.enemy==true then
		enemy.attackname=self.attackname
		if user.attacking==true then 
			self.hp=self.hp-user.attack
		end
	end
	Vagikarp:levelup()
	if self.hp==0 then
		Vagikarp:faint()
	end
end
function Vagikarp:levelup()--LEVELUP'
	if fight==true then
		if self.user==true and user.win==true and enemy.lose==true then
			self.hp=100
			self.level=self.level+1
			fight=false
		end
		if self.enemy==true and enemy.win==true and user.lose==true then
			self.hp=100
			self.level=self.level+1
			fight=false
		end	
	end
end

function Vagikarp:faint()
	self.hp=100
	fight=false
	if self.user==true then
		user.lose=true
	end
	if self.user==false then
		user.win=true
	end
end
and in case you're wondering about the defining base class stuff(it's very helpful), here.

Code: Select all

class "BasePoke" {
	hp=100, attack=10, name="Base",user=true,enemy=false,level=1,attacking=false,attackname='fap'
}
function BasePoke:__init(hp,attack,name,user,enemy,level,attacking,attackname)
	self.hp=hp
	self.attack=atack
	self.name=name
	self.user=user
	self.enemy=enemy
	self.level=level
	self.attacking=attacking
	self.attackname=attackname
end
http://dl.dropbox.com/u/67827108/bleh.love

User avatar
rokit
Posts: 2095
Joined: 03 Feb 2012, 00:47

Post » 10 May 2012, 21:58

oh btw. thanks for thanking for making the battle system. But it's probably gonna be changed soon. Not from scratch.
Also pokemon Ideas?

User avatar
rokit
Posts: 2095
Joined: 03 Feb 2012, 00:47

Post » 10 May 2012, 22:41

oh here:
UPDATED!!!

Code: Select all

--battle shit  no pokemon here  
--Thanks rokit boy
battle={}--suparray!
option=1 --1=hit 2=item 3=flee all for now
options={"FIGHT","BAG","RUN"}
function setOption(o)
	option=o
end

function getOption()
	return option
end

function battle:keypressed(key)
	if not fight then
		if key=="d" or key=="right" then
			if option < #options then
				option=option+1
			else
				option = 1
			end
		elseif key=="a" or key=="left" then
			if option > 1 then
				option=option-1
			else
				option = #options
			end
		end
		if key=="f" and user.win==false and enemy.win==false then--Starts the attack
			if user.turn==true then
				user.attacking=true 
			end
			if enemy.turn==true then
				enemy.attacking=true 
			end
		end
		if key==" " or key=="enter" then
			if options[option]=="FIGHT" then
				fight=true
				--ATTACK!
			end
			if options[option]=="RUN" then
				runtry=true
			end
		end
	end
end

function battle:update(dt)
	if fight==false then
		user.win=false
		user.lose=false
		enemy.win=false
		enemy.lose=false
	end
	if user.attackname=='fap' then
		user.attack=10
	end
	if enemy.attackname=='fap' then
		enemy.attack=10
	end
	if user.attacking==true then--turn system.
		user.turn=false
		user.attacking=false
		enemy.turn=true
	end
	if enemy.attacking==true then
		enemy.turn=false
		enemy.attacking=false
		user.turn=true
	end
end

function battle:draw()
	local x = 0
	local y = love.graphics.getHeight() - 20
	for n,item in ipairs(options) do
		if not fight then
			if n==option then
				love.graphics.print("["..item.."]",x,y)
			else
				love.graphics.print(" "..item.." ",x,y)
			end
		else
			love.graphics.print(" "..item.." ",x,y) 
		end
		x=x+(item:len()*12)
	end
	if runtry==true then
		love.graphics.print('Ha pussy tried to run!',300,300)
	end
	if fight==true then
		if user.turn==true then
			love.graphics.print("["..user.attackname.."]",0,22)
			love.graphics.print(enemy.attackname,100,22)
		end
		if enemy.turn==true then
			love.graphics.print(user.attackname,0,22)
			love.graphics.print("["..enemy.attackname.."]",100,22)
		end
	end
end
Just some selections.
Will make decresing health and possibly ai later.
EDIT: UPDATED! again

User avatar
Lawnboy
Posts: 836
Joined: 03 Feb 2012, 02:24

Post » 11 May 2012, 02:23

Ha SCREW C0NTRA POKEMON buahaha

Thanks, rokit

I realized why leveling up and stuff was so fucked up, here's the new pokemon.lua.

Code: Select all

class "BasePoke" {
	hp=100, name="Base",user=true,enemy=false,level=1,attacking=false,attackname='fap'
}
function BasePoke:__init(hp,name,user,enemy,level,attacking,attackname)--Sets how you would name a custom pokemon
	self.hp=hp
	self.name=name
	self.user=user
	self.enemy=enemy
	self.level=level
	self.attacking=attacking
	self.attackname=attackname
end
Vagikarp=BasePoke:new(100,"Vagikarp",true,false,1,false,'fap')--"Sorry, you're a failure as a human, here, take this vagicarp"-camewel
function Vagikarp:draw()--Draws Vagikarp.  For creating custom pokemon, follow Vagikarp's lead.
	if self.user==true then
		love.graphics.print(self.name,0,0)
		love.graphics.print(self.hp,0,11)
		love.graphics.print('lvl:'..self.level,60,0)
	end
	if self.enemy==true then
		love.graphics.print(self.name,100,0)
		love.graphics.print(self.hp,100,11)
		love.graphics.print('lvl:'..self.level,150,0)
	end
end
function Vagikarp:fight()
	if fight==true then--This fight system is a lil messy.  Lemme explain.
		if self.user==true then
		user.attackname=self.attackname--This means that the player's attack=Vagikarp's attack
			if enemy.attacking==true then 
				self.hp=self.hp-enemy.attack--Where the damage is inflicted.  The rest is in battle.lua
			end
		end
		if self.enemy==true then
			enemy.attackname=self.attackname
			if user.attacking==true then 
				self.hp=self.hp-user.attack
			end
		end
	end
	Vagikarp:levelup()
	if self.hp==0 then
		Vagikarp:faint()
	end
end
function Vagikarp:levelup()--LEVELUP'
	if self.user==true and user.win==true and enemy.lose==true then
		self.hp=100
		self.level=self.level+1
		fight=false
	end
	if self.enemy==true and enemy.win==true and user.lose==true then
		self.hp=100
		self.level=self.level+1
		fight=false
	end	
end

function Vagikarp:faint()--Self explanatory.
	self.hp=100
	if self.user==true then
		user.lose=true
	end
	if self.user==false then
		user.win=true
	end
end
Twattle=BasePoke:new(100,"Twattle",false,true,1,false,'fap')
function Twattle:draw()
	if self.user==true then
		love.graphics.print(self.name,0,0)
		love.graphics.print(self.hp,0,11)
		love.graphics.print('lvl:'..self.level,60,0)
	end
	if self.enemy==true then
		love.graphics.print(self.name,100,0)
		love.graphics.print(self.hp,100,11)
		love.graphics.print('lvl:'..self.level,150,0)
	end
end
function Twattle:fight()
	if fight==true then
		if self.user==true then
		user.attackname=self.attackname
			if enemy.attacking==true then 
				self.hp=self.hp-enemy.attack
			end
		end
		if self.enemy==true then
			enemy.attackname=self.attackname
			if user.attacking==true then 
				self.hp=self.hp-user.attack
			end
		end
	end
	Twattle:levelup()
	if self.hp==0 then
		Twattle:faint()
	end
end
function Twattle:levelup()
	if self.user==true and user.win==true and enemy.lose==true then
		self.hp=100
		self.level=self.level+1
		fight=false
	end
	if self.enemy==true and enemy.win==true and user.lose==true then
		self.hp=100
		self.level=self.level+1
		fight=false
	end	
end
function Twattle:faint()
	self.hp=100
	if self.user==true then
		user.lose=true
	end
	if self.user==false then
		user.win=true
	end
end
--------------------------------------------------------------------

User avatar
rokit
Posts: 2095
Joined: 03 Feb 2012, 00:47

Post » 11 May 2012, 08:44

Nice leveling. add a pokemon.

User avatar
Lawnboy
Posts: 836
Joined: 03 Feb 2012, 02:24

Post » 11 May 2012, 12:51

What
A much much easier way of making new pokemon:

Code: Select all

Pokemon=BasePoke:new(100,"Name",false,true,1,false,'attack')
Just check the basepoke thing for all the falses and trues and stuff. Also, you still have to call

Code: Select all

Yourpoke:draw()
Yourpoke:fight()
in the main.lua
https://love2d.org/forums/download/file.php?id=4641

User avatar
rokit
Posts: 2095
Joined: 03 Feb 2012, 00:47

Post » 11 May 2012, 18:53

Cool, i'll edit this with new battle code.

User avatar
Lawnboy
Posts: 836
Joined: 03 Feb 2012, 02:24

Post » 11 May 2012, 23:30

How much improvements are gonna be made?

User avatar
rokit
Posts: 2095
Joined: 03 Feb 2012, 00:47

Post » 12 May 2012, 00:35

LawnboyInAJar wrote:How much improvements are gonna be made?
actual hitting.
Also attacks will be a table for multiple attacks, not only fap.

User avatar
Lawnboy
Posts: 836
Joined: 03 Feb 2012, 02:24

Post » 12 May 2012, 00:39

rokit boy wrote:
LawnboyInAJar wrote:How much improvements are gonna be made?
actual hitting.
Also attacks will be a table for multiple attacks, not only fap.
There is already hitting?
EDIT: Never mind. I see what you mean.

User avatar
rokit
Posts: 2095
Joined: 03 Feb 2012, 00:47

Post » 12 May 2012, 00:48

LawnboyInAJar wrote:
rokit boy wrote:
LawnboyInAJar wrote:How much improvements are gonna be made?
actual hitting.
Also attacks will be a table for multiple attacks, not only fap.
There is already hitting?
EDIT: Never mind. I see what you mean.
Ok.

User avatar
rokit
Posts: 2095
Joined: 03 Feb 2012, 00:47

Post » 12 May 2012, 00:53

Ok lawn can you make self.attackname read as a table and I'll continue with the battle system.

User avatar
Lawnboy
Posts: 836
Joined: 03 Feb 2012, 02:24

Post » 12 May 2012, 01:59

rokit boy wrote:Ok lawn can you make self.attackname read as a table and I'll continue with the battle system.
http://dl.dropbox.com/u/67827108/fuckingtables.love

User avatar
rokit
Posts: 2095
Joined: 03 Feb 2012, 00:47

Post » 12 May 2012, 02:31

Now, TILES AND MAPS!

User avatar
rokit
Posts: 2095
Joined: 03 Feb 2012, 00:47

Post » 12 May 2012, 02:32

Something from C0ntra:

Code: Select all

t = {} --tiles
	t.jungle = {
		sx = 10, sy = 10,
		img = love.graphics.newImage("graphics/tilesets/contra_spritesheet.png"),
		dat = love.image.newImageData("graphics/tilesets/contra_spritesheet.png"),
		quad = {}
	}
	t.jungle.img:setFilter("nearest", "nearest") --no filter shit i think
	--load the img into quads :
	for y = 1, t.jungle.sy do for x = 1, t.jungle.sx do
		t.jungle.quad[(y-1)*t.jungle.sx+x] = love.graphics.newQuad((x-1)*17, (y-1)*17, 16, 16,
		t.jungle.img:getWidth(), t.jungle.img:getHeight())
	end end
	m = {} --maps
	m[1] = {
		{01, 01, 01, 01, 01, 01, 01, 01, 01, 01},
		{01, 01, 02, 03, 02, 03, 02, 03, 02, 03},
		{01, 01, 12, 13, 12, 13, 12, 13, 12, 13},
		{01, 01, 04, 05, 04, 05, 04, 05, 04, 05},
		{01, 01, 14, 15, 14, 15, 14, 15, 14, 15},
		{31, 11, 04, 05, 04, 05, 04, 05, 04, 05},
		{31, 21, 22, 23, 22, 23, 22, 23, 22, 23},
		{31, 31, 31, 31, 31, 31, 31, 31, 31, 31},
		{31, 31, 31, 31, 31, 31, 31, 31, 31, 31},
		sx = 9, sy = 9, t = t.jungle
	}
	t.jungle.batch = love.graphics.newSpriteBatch(t.jungle.img)
	--add each quad to the batch :
	for x = 1+CAM, math.min(t.jungle.sx, SX+CAM+1) do for y = 1, math.min(SY, t.jungle.sy) do
		t.jungle.batch:addq(t.jungle.quad[m[1][y][x]], (x-1-CAM)*16, (y-1)*16)
	end end

User avatar
Lawnboy
Posts: 836
Joined: 03 Feb 2012, 02:24

Post » 12 May 2012, 02:42

No! We're just doing the battle system.

User avatar
rokit
Posts: 2095
Joined: 03 Feb 2012, 00:47

Post » 12 May 2012, 02:45

LawnboyInAJar wrote:No! We're just doing the battle system.
No adventure?

User avatar
Lawnboy
Posts: 836
Joined: 03 Feb 2012, 02:24

Post » 12 May 2012, 02:53

rokit boy wrote:
LawnboyInAJar wrote:No! We're just doing the battle system.
No adventure?
That probably could be done relatively easy, but right now, let's keep it to battles.

User avatar
rokit
Posts: 2095
Joined: 03 Feb 2012, 00:47

Post » 12 May 2012, 02:53

LawnboyInAJar wrote:
rokit boy wrote:
LawnboyInAJar wrote:No! We're just doing the battle system.
No adventure?
That probably could be done relatively easy, but right now, let's keep it to battles.
So, adventure later?

User avatar
Lawnboy
Posts: 836
Joined: 03 Feb 2012, 02:24

Post » 12 May 2012, 02:55

sure.

User avatar
rokit
Posts: 2095
Joined: 03 Feb 2012, 00:47

Post » 12 May 2012, 02:55

Ok what's next?

User avatar
Lawnboy
Posts: 836
Joined: 03 Feb 2012, 02:24

Post » 12 May 2012, 02:58

a custom pokemon maker, and items..

User avatar
rokit
Posts: 2095
Joined: 03 Feb 2012, 00:47

Post » 12 May 2012, 03:02

LawnboyInAJar wrote:a custom pokemon maker, and items..
seperate love for maker? for now?

User avatar
Lawnboy
Posts: 836
Joined: 03 Feb 2012, 02:24

Post » 12 May 2012, 03:06

rokit boy wrote:
LawnboyInAJar wrote:a custom pokemon maker, and items..
seperate love for maker? for now?
Yes

User avatar
rokit
Posts: 2095
Joined: 03 Feb 2012, 00:47

Post » 12 May 2012, 17:07

So imma start inventory.
SWEET TABLES!

User avatar
Lawnboy
Posts: 836
Joined: 03 Feb 2012, 02:24

Post » 12 May 2012, 17:24

rokit boy wrote:So imma start inventory.
SWEET TABLES!
Are you glad I made the attacks tables? :p

User avatar
rokit
Posts: 2095
Joined: 03 Feb 2012, 00:47

Post » 12 May 2012, 17:29

LawnboyInAJar wrote:
rokit boy wrote:So imma start inventory.
SWEET TABLES!
Are you glad I made the attacks tables? :p
yes

User avatar
Lawnboy
Posts: 836
Joined: 03 Feb 2012, 02:24

Post » 12 May 2012, 19:09

What's the code for creating items? that is, if you made it yet

User avatar
rokit
Posts: 2095
Joined: 03 Feb 2012, 00:47

Post » 12 May 2012, 19:14

I'll satrt on it. Later.

User avatar
Lawnboy
Posts: 836
Joined: 03 Feb 2012, 02:24

Post » 12 May 2012, 19:19

do you think I should make pictures into this?

User avatar
rokit
Posts: 2095
Joined: 03 Feb 2012, 00:47

Post » 12 May 2012, 19:29

LawnboyInAJar wrote:do you think I should make pictures into this?
yeh

User avatar
rokit
Posts: 2095
Joined: 03 Feb 2012, 00:47

Post » 12 May 2012, 20:54

Lawn, make a player class

User avatar
rokit
Posts: 2095
Joined: 03 Feb 2012, 00:47

Post » 12 May 2012, 22:00

Code: Select all

require "class" --cause we makin' classes

class "Trainer" { --cause we makin a trainer
	name="Douchebag",bag={},pokemons={},battle=false,sex="male" --fitting name
} 

function Trainer:__init(name,bag,pokemons,battle,sex) --Setting st00f
	self.name = name --string, name
	self.bag = bag --table, what he got in his bag
	self.pokemons = pokemons --table, his pokemons
	self.battle = battle --boolean, if he is in a battle
	self.sex = sex -- string, male or female
end

function Trainer:draw() --What he has in his coloring book

end

function Trainer:load() --reload?

end

function Trainer:update() --I don't know another way of saying update

end

Moustache = Trainer:new("Moustache",{},{},false,"male") --Moustache, ash, get it?

Now, bag and AI.
Lawn, finish this.
Also i'll make battle.lua trainer dependent not pokemon dependent

User avatar
Lawnboy
Posts: 836
Joined: 03 Feb 2012, 02:24

Post » 13 May 2012, 00:16

Sorry bout that, was busy all day. I'll work on this later.

User avatar
rokit
Posts: 2095
Joined: 03 Feb 2012, 00:47

Post » 13 May 2012, 00:57

Should we have NPC trainer names as forum people names?
(my bro's idea)

User avatar
penguin321
Posts: 165
Joined: 03 Mar 2012, 23:01

Post » 13 May 2012, 01:21

Yeah we should because that's my idea...
There should be some hidden Easter eggs like lavender town missing frequencies in pokemon blue...
EDIT:
Here it is the background music visualized using a program:

Skip to 8:50 when you see it...
You'll shit brix...

User avatar
renhoek
Posts: 4545
Joined: 11 Feb 2012, 10:04

Post » 13 May 2012, 02:44

I still want to know what they were on when they made that music...
the game's like

YAY look at all the cute pokemon with their pickachus and charmanders and
DEATH nothing BUT DEATH EVERY WHERE THEY WILL DIE AND SO WIL YOOOOOOOU!!!

User avatar
Hatninja
Posts: 480
Joined: 03 Feb 2012, 18:42
Contact:

Post » 13 May 2012, 02:45

o_O

well...
I IZ OFF TO MAYKE MEH OWN PWN POKEYMONZ
Last edited by Hatninja on 13 May 2012, 03:54, edited 2 times in total.

User avatar
penguin321
Posts: 165
Joined: 03 Mar 2012, 23:01

Post » 13 May 2012, 02:51

Have you noticed that next to the ghost they put some unknowns...
They spell "leave now"

Post Reply