forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

2d side scrolling platformer

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Lua Player Development
View previous topic :: View next topic  
Author Message
chriso



Joined: 21 Mar 2006
Posts: 6

PostPosted: Sat Apr 22, 2006 9:19 pm    Post subject: 2d side scrolling platformer Reply with quote

Apologies for cross posting (also on psplua).


I have made a basic platform game before in Flash and also an engine in Director, now I want to make an open source tiled platform engine for my own use, but for others to use and improve.

I am new to lua, but not to programming.

Based on this tutorial as a starting point...
http://wiki.ps2dev.org/psp:lua_player:tutorial#full_game_sample_with_tiles_animation_etc

My first job is to get it scrolling at variable speeds.

Initial thoughts are:
- store viewable area / position
- blit the tiles viewable to an image in memory
- then blit this image to the screen
- as the screen scrolls, get the next set of tiles and add them a column at a time

-[update]
here is my first progress. Have tiles being drawn to screen and scrolling left & right. What do you think?

http://www.pixelsumo.com/_lua/platform.zip

I have a few questions you may be able to help with.

1) How can I smoothly scroll with a unit less than 1, i.e. 0.2
map_currentview_x = map_currentview_x + 0.2

2)
I want to only blit new tiles, not redraw the whole set each time, is this possible?

so i imagine:
blit a new coloumn to an image in memory
blit this image to the screen

The trouble is, if i create an image in memory, then blit the background to screen, then the image in memory to screen over the background, the image in memory isnt transparent so it just has a black background.
Back to top
View user's profile Send private message
glynnder



Joined: 04 Sep 2005
Posts: 35

PostPosted: Sun Apr 23, 2006 5:37 am    Post subject: Reply with quote

hmmm, i use director. are you good @ lingo?
Back to top
View user's profile Send private message
chriso



Joined: 21 Mar 2006
Posts: 6

PostPosted: Sun Apr 23, 2006 6:56 pm    Post subject: Reply with quote

glynnder wrote:
hmmm, i use director. are you good @ lingo?


Yes, although it doesn't help me with programming Lua, as its mainly blit to screen & speed issues.
Back to top
View user's profile Send private message
Shine



Joined: 03 Dec 2004
Posts: 728
Location: Germany

PostPosted: Sun Apr 23, 2006 9:45 pm    Post subject: Re: 2d side scrolling platformer Reply with quote

chriso wrote:
The trouble is, if i create an image in memory, then blit the background to screen, then the image in memory to screen over the background, the image in memory isnt transparent so it just has a black background.


Take a look at the Snake game, which does exactly this (and uses the non-alpha parameter for blitting the background for speed). yourImage:clear() sets the background to transparent color.
Back to top
View user's profile Send private message
thsock



Joined: 25 Sep 2005
Posts: 25

PostPosted: Sun May 14, 2006 1:46 pm    Post subject: Reply with quote

why not just make a frame by frame instead of a side scroller. checkout stickman sam.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Lua Player Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group