Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

2D All the way! / 2D Games

Author
Message
Garfield1983
21
Years of Service
User Offline
Joined: 13th Nov 2002
Location:
Posted: 10th Jan 2003 04:17
I'm slowly learning about sprites and I recently found a great site on drawing sprites:

http://www.indie-rpg.net/pixel-zone/shtml/home.shtml

In particular, if you go to the 'pixel tutorial' section and open the 'So you want to be a pixel artist?' tutorial, it covers everything from crating tiles for a 2D game to making little 2D characters, perfect for a beginner like me.

Here's a direct link to the tutorial:

http://pixeltutorial.cjb.net/

**************

Okay so I've given you something, now I need something bacK!lol I need help=S

Completely new to game programming, I'm trying to make a little 2D game where the player walks about a little town and talks to other characters. Kinda like the screenshots of games shown in that tutorial above.

I read that tutorial on making tiles for your games but I want to know how to actually turn them into what you see on screen? Do you simply tile the little tile images across the screen, making sure they match up and repeating where necessary, or is there some kind of grid (like the 2D version of a matrix) you construct to hold them? The tutorial above was very in-depth on making them but didn't actually cover any coding=(

Second question -I know I ask too many questions but hey, i'm eager to learn! - I'm using the following code to move a sprite down the screen (As if the player is walking to the bottom of a 2D scene). it works fine but when I try to add more code for moving in the other directions (Up,Down, Left,Right) I get nesting errors.

Loops have always been something I'm good with but having the animation statements in there screws things up=S Can anyone help?

rem Player starting x and y values

player1x = 100
player1y = 100

rem Movement
DO
IF DOWNKEY()
player1y=player1y+4
INC frame
IF frame > runendframe THEN frame = runstartframe
ELSE
frame = stillframe
ENDIF

SPRITE 1,player1x,player1y,frame

SYNC
LOOP


Any help would be greatly appreciated.
Oraculaca
21
Years of Service
User Offline
Joined: 6th Jan 2003
Location: Scotland
Posted: 11th Jan 2003 04:42
Im probably wrong but I would set out my if's like so, ive not incorporated the frame increment but you get the idea

DO
IF UPKEY()=1 THEN DEC player1y,4
IF DOWNKEY()=1 THEN INC player1y,4
IF LEFTKEY()=1 THEN DEC player1x,4
IF RIGHTKEY()=1 THEN INC player1x,4

SPRITE 1,player1x,player1y,frame
SYNC
LOOP

Login to post a reply

Server time is: 2024-11-09 23:17:29
Your offset time is: 2024-11-09 23:17:29