We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I am new to processing and currently trying to create a game where the map moves according to the player. Any ideas? I am having troubles using the panning function. Please Help!
Answers
You mean like in Mario? (omg i just realize some day people will ask what is Mario :) )
I would start by making a tile map. I think you can find most tutorials on this about flash, like this one: http://gamedevelopment.tutsplus.com/tutorials/an-introduction-to-creating-a-tile-map-engine--gamedev-10900
It should not be that different from processing.
For the rest, what are your current problems with the panning. You don't give a lot of info.
it might depend if you use 2D, isometric or 3D
let's assume 2D.
since you write about a map, you probably have that.
pls show your code then we can help better
anyway: you could work with a viewport - it defines which part of the large map you show (you virtually move your monitor over the map)
I suggest the player is always in the center of the screen
when he moves right, the viewport wanders right as well
e.g. when your map is a 2D grid much bigger then the screen, you then read it out from position viewportX = 350. 350 being the column where you start reading from the map.
you place column 350 at pos 0 of the screen. col 351 is at pos 20 of the screen (when the tiles of your map are 20x20 pixels).
Greetings, Chrisir ;-)
Here is the program:
The game is 2D, and I want to move it like Zelda. When the camera moves according to where zelda is moving.
this is another idea .
it doesn't come with a 2D grid but is just a very big image (2000x2000)
don't PM, better post here in the thread
you could have a 2D array instead of the image (see tutorial 2D arrays pls)
the array is much bigger than the screen
when you move, don't move the player but change the start pos x and y where you begin
see also clankiller above
and
http://www.openprocessing.org/sketch/76025
I am on a journey and can't work on it
The maze I pointed you to has a map and grid (in tab maze)
But no panning
;-)
I had time now to work on it
you'll find the result here:
http://www.openprocessing.org/sketch/149191
it doesn't run in the browser, but you can download it from there.
it has a player and panning (and no zooming)
you might want to use a player from this great sketch
http://www.openprocessing.org/sketch/26391
posted a new version of the map sketch
http://www.openprocessing.org/sketch/149191
(runs in my browser - linux, firefox, iced tea java)
I see.
;-)