UnderwareDesign
April 28, 2017, 07:20:13 AM *
News: G2D - 2D OpenGL library V007 for PlayBASIC V1.64P - Including Programmable Particles   (Released 22nd,Nov 2014)
   Home    
Pages: [1] 2 3 ... 24
 
Author Topic: For Foxes Sake WIP  (Read 24507 times)
Member

« on: August 19, 2012, 03:54:41 AM »


theres a couple of nice looking projects in the show case that im very much looking forward to when released,
so i think im going to start a longer project here , with the option to jump to another small project inbetween
that way gives me some freedom , so heres a simple looking and hopefully simple to program scrolling platform game in the mario type theme
with things to collect , dodge , kill etc
at the moment the map blocks are 64x64 pixels so a 16X12 screen at 1024x768 resolution , a bit large i know but going to try and get away with this if i can
heres a starting level screen shot , but this will take a while to complete i would have thought

btw , some of you might reconise the man from another demo in the PB folder

mick Smiley


jjf.jpg (53.13 KB, 717x538 - viewed 191 times.)
Logged
Member

WWW
« Reply #1 on: August 19, 2012, 04:09:01 AM »

nice idea =) good luck micky4fun
Logged
Member
Development Team


WWW
« Reply #2 on: August 19, 2012, 10:05:07 AM »

Quote
so heres a simple looking and hopefully simple to program scrolling platform game in the mario type theme
with things to collect , dodge , kill etc
at the moment the map blocks are 64x64 pixels so a 16X12 screen at 1024x768 resolution , a bit large i know but going to try and get away with this if i can
heres a starting level screen shot , but this will take a while to complete i would have thought

  Yeah making the levels is always the sticking point.  So do yourself a huge favor and build a level/world editing tool.  Doesn't have to be pretty,  just enough to stick the blocks in place, drop the starting positions of the characters and set whatever global variables the world has.  

   Thankfully, the original mario games are based on some pretty simple rules, so the coding side of it should be a breeze.    


Quote
btw , some of you might reconise the man from another demo in the PB folder

    I think that's another blink one.  It's a version of some other guys walking dude, can't remember the name.  Will have to search for the thread in minutes,  it's on here somewhere.

    Found it, It's Draco's Tale (login required)
 
Logged

Member


« Reply #3 on: August 19, 2012, 05:08:16 PM »

sounds good mick. i've heard some very good things about the tiling system in PB.
there are a lot of very good free tile graphics out there if you wanna look around too
Logged
Member

« Reply #4 on: August 20, 2012, 09:40:29 PM »

cool micky. looking forward to see what you come up with.

i found platformers fun to make. learnt a lot too. post code when you can so we can see your progress.

  stevmjon
Logged

re-starting my platform game from scratch...determined to release a demo!
...if i can stop playing 'Skyrim' that is. oh look, another game expansion. must download now.
Member

« Reply #5 on: August 21, 2012, 03:31:59 AM »

Hi All

Quote
So do yourself a huge favor and build a level/world editing tool.  Doesn't have to be pretty,
yes think i will take your advice here , i can be a bit of lets just get going , but as i am going to take time on this i will knock one up and your right again it wont be pretty , haha

Quote
sounds good mick. i've heard some very good things about the tiling system in PB.
there are a lot of very good free tile graphics out there if you wanna look around too
yep BlinkOk will try and go a bit deeper in the maps commands , only really used it very lighty in Bank Job game

Quote
cool micky. looking forward to see what you come up with.
thanks stevmjon , me to , platform games are my favourite type of game , so about time i tried one
yes will post any updates as soon as it starts taking shape

mick Smiley
Logged
Member


« Reply #6 on: August 21, 2012, 05:38:31 AM »

there are a few 3rd party/free level editors out there. you might wanna check them out too.
Logged
Member

« Reply #7 on: August 21, 2012, 12:30:46 PM »

Hello Mickey4fun!

Sounds and looks interesting! Let you know us, how you manage your program?
I like jump and run games, too!  Smiley

Sigtrygg
Logged
Member

« Reply #8 on: August 22, 2012, 12:57:16 AM »

I don't know how old this post is but I'm going to reply.
Mick if you want I can sit down with you and take some time to help you build a nicer tile/level editor.
The first step is to figure out a sort of format for your levels.
If you design a level file first it becomes alot easier to read in and out the level data.
I recently got into doing this sort of habit rather than having to re load all my level data every single time I wanted to test a new mechanic in my test level using my dkc2 game engine. xd and yeah it will save you a ton of time when debugging to already have set up.

The first method you should use once you load all your images/sound/media and set all your variables and arrays up is start loading the level.

To help you out I'll post my level loading code from my dkc2 editor. Feel free to adjust/change it to your liking. Actually. I'll do you one better.
I'll give you the code that saves the level file and the code that loads it!


Saves:
PlayBASIC Code:
if mouseinbox(0, 600, 0+(128*2), 664)
      if leftmousebutton()
            
            if fileexist("C:/brambles_map2.txt")
            deletefile ("C:/brambles_map2.txt")
         endif
               
            
               writefile "levels\brambles_map2.txt", 1
               
               writeint 1, Mapwidth
               writeint 1, mapheight
               writeint 1, charx
               writeint 1, chary
               writeint 1, scrollx
               writeint 1, scrolly
            
            for tempx=1 to Mapwidth
               for tempy=1 to mapheight
                  writeint 1, map(tempx, tempy)
                  writeint 1, solids(tempx, tempy).x1
                  writeint 1, solids(tempx, tempy).y1
                  writeint 1, solids(tempx, tempy).x2
                  writeint 1, solids(tempx, tempy).y2
               next tempy
         next tempx
                  
                  for tempx=1 to MAPWIDTH/2
                     for tempy=1 to MAPHEIGHT/2
                     writeint 1, TILEMAP(tempx, tempy)
                     next tempy
                        next tempx

for temp=1 to 30
   writeint 1, b_barrels(temp).facing_type
   writeint 1, b_barrels(temp).x1
   writeint 1, b_barrels(temp).y1
   writeint 1, b_barrels(temp).x2
   writeint 1, b_barrels(temp).y2
next temp
            
            closefile 1
                  
         
      endif
      endif   





Loads:

PlayBASIC Code:
read=false
if fileexist("levels\brambles_map2.txt") then read=true

IF READ=TRUE
readfile "levels\brambles_map2.txt", 1
ink rgb(0, 0, 255)
tile_to_read=1
totaltiles=MAPWIDTH*MAPHEIGHT
rendertoscreen
Mapwidth=readint(1)
mapheight=readint(1)
charx=readint(1)
chary=readint(1)
scrollx=readint(1)
scrolly=readint(1)
dim map(MAPWIDTH, MAPHEIGHT)
dim TILEMAP(MAPWIDTH/2, MAPHEIGHT/2) ;32 by 32 pixel tiles
dim solids(MAPWIDTH, MAPHEIGHT) as solid_tile

coinframetimer=timer()+30





for tempx=1 to MAPWIDTH
   for tempy=1 to MAPHEIGHT
      map(tempx, tempy)=readint(1)
      solids(tempx, tempy).x1=readint(1)
      solids(tempx, tempy).y1=readint(1)
      solids(tempx, tempy).x2=readint(1)
      solids(tempx, tempy).y2=readint(1)
      x1=solids(tempx, tempy).x1
      y1=solids(tempx, tempy).y1
      x2=solids(tempx, tempy).x2
      y2=solids(tempx, tempy).y2
      ;rendertoimage castle
      ;box x1, y1, x2, y2, 
      ;rendertoscreen
      
      
      ;tile_to_read=tile_to_read+1
next tempy
      print "Loading SOLID TILE DATA PLEASE WAIT "
      print "Reading Across X: "+str$(tempx)
      print "Total Reads remaining: "+str$(MAPWIDTH-tempx)
      percent#=((tempx*100)/MAPWIDTH)
      print "Percent completed "+str$(percent#)
      ink rgb(percent#*2, percent#, 255)
      box 200, 50, 200+(percent#)*5, 60, 1
      ink rgb(0, 255, 0)
      box 200, 50, 200+100*5, 60, 0
      drawimage dk_barrel_(dkcoinframe), 180+percent#*5, 20, 1
      sync
      cls rgb(0,0,0)   
      
            
            
               
      
      dkcoinframe=dkcoinframe+1
      
         
            if dkcoinframe=>7
         dkcoinframe=1
      endif
         
next tempx

          

for tempx=1 to MAPWIDTH/2
   for tempy=1 to MAPHEIGHT/2
      TILEMAP(tempx, tempy)=readint(1)
   next tempy
next tempx

for temp=1 to 30
   b_barrels(temp).facing_type=readint(1)
   b_barrels(temp).x1=readint(1)
   b_barrels(temp).y1=readint(1)
   b_barrels(temp).x2=readint(1)
   b_barrels(temp).y2=readint(1)      
next temp
   

closefile 1

   falling=true
   mode$="playmode"

   ENDIF
      




Of course this is a bit advanced because the loading screen has a progress bar rendering on it as well.
And not only that but also the sprites are read in as well and their positions on the map.
Logged
Member
Development Team


WWW
« Reply #9 on: August 22, 2012, 02:49:50 PM »

Mick,

Quote
 yes think i will take your advice here , i can be a bit of lets just get going , but as i am going to take time on this i will knock one up and your right again it wont be pretty , haha

  That'd be first Smiley ...  Anyway, there's a lots and lots of ways to externalize the 'game' data from the program.   Many of which are more hassle than they're worth.  The easiest solutions store the minimal amount of level/character entity info in the file.  I'd prolly use a markup format (Text files) rather than a binary format, as it allows the 'level maker person' to make changes easily.  (NotePad).    

  So depending what you're aiming at, you'd define the animations, character types, level layouts, world properties and level all externally.  Ideally, the structures are set out in some human readable form.  Basically you load the text file(s) into memory, split it each one to an array, then run through it (top to bottom) looking for the action tags.   Ideally the tags should make sense to head reader.


Code:

; Start Of Section Define
Level-Start

   ; Time player has to complete level
   Time Limit = 60

    ; etc etc

Level-End
; End Start Of Section Define



Animations-Start


;
AddAnim
{
             Name= PLAYER_RUNNING
    MaskColour = $ff00ff
    Frames   =Running1.png,Running2.png
}


AddAnim
{
             Name=PLAYER_WALKING
    MaskColour = $ff00ff
    Frames   =Walking1.png,Walking2.png,Walking3.png
   
}

Animations-END



      
     The program doesn't use this information as is, it imports/parses the materials into whatever arrays/structures inside the game.   So the actually programming isn't really any different.  With one HUGE exception, resource are dynamically allocated.   Making the program a lot more expandable. 
 



  

 Food For Thought,

 * Entity Example (Loading Game Levels)
 * Combine two words to make an array?(Sprite Animations)
 * Thesius XIII




Logged

Member


« Reply #10 on: August 22, 2012, 04:40:42 PM »

http://www.ogmoeditor.com/ or http://codeboje.de/list-of-2d-map-editors/
then you can just get on with the game
Logged
Member

« Reply #11 on: August 22, 2012, 06:39:14 PM »

Hi all

well lots of help here thanks guys

LemonWizard , thanks for code have looked through it and given me a few ideas ,
BlinkOk , thanks for link to level editor , i have just installed that and will give that a go , just going to read the tutorial , ahh more there now loads to choose from , well thats tomorrow taken up ,
Kevin , thanks for code snippets and advice on level/map editor

well today i have spent most of the day just doing that , trying to make a level/map editor , well tried 2 differant ways but then ran into problems if i wanted a large map/level
then ironically , i tried making a map editor using the map commands and that seems the best at the moment its basic but can be added apone  , though i have one small problem with that , but dont think at this stage its a worrie
but someone there might see what im doing wrong , if i can explaine it properly
ok here goes , if you load the map editor up ,  at the moment im using 64x64 pixels per tile on a screen res of 1024x768 so 16x12 tiles, yep rather large
so to start just do a 16 tiles across by 12 tiles down by 1 screen across by 1 screen down
now use mouse to select tile to use from above tiles , then place them on grid layout by pressing mousebutton 1 , delete tile if placed in wrong place by pressing mouse button 2
you can use arrow keys to move map if you do a large one later on , but try this first to see my problem , i have 17 squares by 13 instead of 16 by 12 , i have just the little white box of the image to fill tiles not needed

ok once your map is done , just do a screen border to start , then press spacebar to save the file , this will be data1 file

now copy that file to the platform v1 folder overwriting file already there
load up platform v1 and run , you man always falls from top of screen to bottom , so make sure he has a block to fall on
then just use the arrow keys to move him , all very basic movements at the moment

the saved data1 file contains first the map x amount and then the map y amount , then all the tiles
the trouble i have is in the map editor v1 i need to get rid of the unwanted row of tiles x and y
and onced saved will load ok into platform v1 program , but its not a major worry , but would be nice to clear up

ok bed long day
thanks again guys
mick Smiley



map.png (48.79 KB, 768x576 - viewed 129 times.)
map editor v1.rar (5.09 KB - downloaded 6 times.)
platform v1.rar (9.96 KB - downloaded 7 times.)
Logged
Member
Development Team


WWW
« Reply #12 on: August 23, 2012, 02:54:08 AM »


   Looking at the editor I'm not sure why you've got map level and array to mirror the level.   But anyway, I suspect the sizing is different because  array bounds are inclusive->inclusive and map levels are inclusion -> exclusive.   So an array of 10 items, actually has 11 valid indexes   (0,1,2,3,4,5,6,7,8,9,10 )  Where a level that's 10 tiles wide say, has only 10.  0,1,2,3,4,5,6,7,8,9

   In the editor,  what i'd prolly do is set up areas of gadgets.  So one area would be the block palette (like you've got),  another might be help window.  Some just text drawn to a image and splodged in front.  Where Key short cuts..  Another might be menu dialog      Since this is simple GUI,  when the user clicks or moves the mouse,  it's important the programs reaction is relative to the area.  So when over the block palette clicks, this only affect block selection and not drawing.    Same goes for any other windows. 

   Anyway, ideally the two program would use the same include files, which is something you've never done before.  An include is just a chunk of code, generally fully functions or declarations (types/ arrays / constants).   Having them both share code, makes programming a 1000 times faster.  You write once and the once both sides share the changes.     

   
Logged

Member

« Reply #13 on: August 23, 2012, 05:55:20 PM »

Hi all

well thanks again to all ,
i did try all the level editors and the D2Dmapeditor was the nearest i could use i think ,
i will come back to that a little later and give it a full try out , if not may continue with mine
but for the time being now i want to get use to the map commands and suss out what i can and cant do , what is easy for me to do and what will be to hard for me to get to grips with and go the easy root,

Quote
Looking at the editor I'm not sure why you've got map level and array to mirror the level
oh dear , oh yes i have taken the grid array out now and used the peektile command to get the tile info out to save as file

ok while tinkering around today i was wondering if theres an easy way to get my man to jump up one tile at a time , while standing under say 3 tiles on top of each other and say while on second tile still be how to move left and right on that tile
and jump up one more tile even though that tile is directly above him , as in picture
hope i have explained that well , would i have to do a map with differant levels to do that ?

i have include code , so i want him to move along first stack of tiles walk in front of them . and jump up one tile level even when there are 3 tiles above hes head and land just one level up from where he was

is that possible without being very complicated anyones help would be appricated
thanks
mick Smiley


io.png (228.38 KB, 615x461 - viewed 140 times.)
platform v2.rar (29.5 KB - downloaded 5 times.)
Logged
Member


« Reply #14 on: August 23, 2012, 08:38:45 PM »

here is a little dude i made ages ago (he's in the PB banner), run, jump and stand (the stand one is a stand + look around)
i'm not sure if the run is too fast for what you want but if it's ok you're welcome to use him



 originals: run - stand - jump



kid.rar (49.74 KB - downloaded 9 times.)
Logged
Pages: [1] 2 3 ... 24
 
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.13 | SMF © 2006-2009, Simple Machines LLC | Privacy Policy Valid XHTML 1.0! Valid CSS!