NEED HELP REAL BAD WITH IMAGES ON MY GAME !!!!!!!!!

Discuss using and improving Lua and the Lua Player specific to the PSP.

Moderators: Shine, Insert_witty_name

Post Reply
chrismackle
Posts: 2
Joined: Sat May 17, 2008 4:34 pm

NEED HELP REAL BAD WITH IMAGES ON MY GAME !!!!!!!!!

Post by chrismackle »

Im making a POKEMON game for psp in lua but when i put pictures of like houses and trees on the game the character just walks ontop of it i want to know how i can make it so u cant walk on the houses so u stop moving on the sides

MY GAME WILL BE RELEASED !!! AS SOON AS I FIND OUT !!!

Please help
PiCkDaT
Posts: 69
Joined: Thu Oct 04, 2007 9:49 pm

Post by PiCkDaT »

Make an array of a map like this

map = {
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,2,2,2,2,2,2,2,2,2,3,2,2,2,2,2,2,2,1,
1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
}

just as an example make 1 = water and 2 = grass(walkable) and 3 = house... what you do is keep track of where the character is on the map and depending on that and what space the character will move to next you can say...

tileUp is a function that looks for the tile above the character

if tileUp = water or tileUp = house then canWalkUp = false end

hope this gives you an idea.
Enlighten me, Reveal my fate -- Follow - Breaking Benjamin
Crux
Posts: 10
Joined: Sun May 25, 2008 1:46 pm

Post by Crux »

I just have one comment to add to the above poster. Use numbers that aren't walkable on in the thousands (water would be 1000, a mountain maybe 1001, etc.), and those tiles that are walkable on everything under that(grass = 0, path = 1, etc).

I've gone the route of making a RPG and it just makes it easier to keep them separated. Keep it organized its a big project I'm sure. Good luck!

Edit: Also check this link if you've no idea what we're talking about http://www.evilmana.com/tutorials/lua_tutorial_12.php
Post Reply