A little teaser for my upcoming 2d platform game tutorial

The place for any Hollywood tutorials
amyren
Posts: 352
Joined: Thu May 02, 2019 11:53 am

Re: A little teaser for my upcoming 2d platform game tutorial

Post by amyren »

airsoftsoftwair wrote: Sat Feb 11, 2023 11:09 pm Have you tried asking ChatGPT about it? *scnr* ;)
Me:
Where can I find the demo sources for the 2d platform game made by user jalih who posted a now expired dropbox file link on the Hollywood forums?

ChatGPT:
I'm sorry, but without more information, it is difficult for me to provide a specific answer. However, here are some general suggestions on where to look for demo sources for a 2D platform game made by a user named "jalih":

Hollywood Forums: You mentioned that the user posted the link on the Hollywood forums. Have you tried reaching out to the user or other members of the forum to see if they have a backup of the demo sources? If not, it might be worth starting a new thread asking for help.

Archive.org: The Internet Archive (archive.org) is a digital library of websites and other digital content. You can use the Wayback Machine to search for old versions of the Hollywood forums or other websites where the user might have shared the demo sources.

GitHub: GitHub is a popular platform for hosting and sharing open-source code. It's possible that the user might have shared the demo sources on GitHub. You can search for the user's username or keywords related to the game to see if anything comes up.

Game Development Forums: There are many game development forums out there where users share their work and help each other out. You might try searching some of these forums to see if anyone has a backup of the demo sources.

Contact the User Directly: If you can find contact information for the user, you might try reaching out to them directly to see if they can provide the demo sources or point you in the right direction.

I hope these suggestions are helpful, and good luck in your search!
User avatar
schiumacal
Posts: 3
Joined: Thu Mar 30, 2017 2:24 pm

Re: A little teaser for my upcoming 2d platform game tutorial

Post by schiumacal »

I am also following with interest because unfortunately I cannot find the right topics. Even by consulting Chatgpt, I cannot find anything.
Bugala
Posts: 1178
Joined: Sun Feb 14, 2010 7:11 pm

Re: A little teaser for my upcoming 2d platform game tutorial

Post by Bugala »

anyone remember that files name? I should have it, but don't remember where. Could use search if I would remember the file name
jalih
Posts: 276
Joined: Fri Jun 18, 2010 8:08 pm
Location: Finland

Re: A little teaser for my upcoming 2d platform game tutorial

Post by jalih »

I should probably rewrite the Hollywood version of my simple tilemap engine or just write a simple tutorial explaining the basic concepts of old school platformer.

I have an updated version with collision map support of my library for the 8th programming language. It still needs some work but can already make your head hurt, if you read the source... :D

You can test the current functionality with these binaries and tell me, if you would like to see a tutorial explaining the concepts. It's best to run Linux versions without X for the best performance.

Here is a needed 8th code for a simple platformer without enemies using my library:

Code: Select all

needs nk/gui
needs nk/keyboard
needs games/state
needs games/tilemap

22 font:system font:new "font1" font:atlas! drop

800 constant SCREEN-WIDTH
600 constant SCREEN-HEIGHT

640 constant VIEWPORT-WIDTH
480 constant VIEWPORT-HEIGHT

SCREEN-WIDTH 2 n:/ VIEWPORT-WIDTH 2 n:/ n:- constant VIEWPORT-X
SCREEN-HEIGHT 2 n:/ VIEWPORT-HEIGHT 2 n:/ n:- constant VIEWPORT-Y 

32 constant TILE-WIDTH
32 constant TILE-HEIGHT

32 constant SPRITE-WIDTH
75 constant SPRITE-HEIGHT
SPRITE-WIDTH 4 n:* constant 4X-SPRITE-WIDTH

true constant WAIT-VSYNC
1 60 n:/ constant DT

\ Game states.
0 constant MAIN

{
  bg: "black",
  padding: [0,0],
 flags: [ @nk:WINDOW_NO_SCROLLBAR ]
} constant main-render

"data/left.png" img:new constant left-img
"data/right.png" img:new constant right-img
"data/cat.png" img:new constant cat-img 

"data/tiles.png" img:new TILE-WIDTH TILE-HEIGHT "data/level.map" map:load constant level
"data/tiles.png" img:new TILE-WIDTH TILE-HEIGHT "data/collision.map" map:load constant collision
VIEWPORT-WIDTH VIEWPORT-HEIGHT VIEWPORT-X VIEWPORT-Y viewport:new constant vp

level map:rect@ nip 2 a:_@ constant MAP-WIDTH 

0.5 constant GRAVITY

var x
var y
var dx
var dy
var scrollx
var jumping
var scrolling
var flipx
var delay
var frame
var time
[@right-img, @left-img] var, image
\ Collision points
[[17,75],[13,75]] var, bottom
[[4,54],[0,54]] var, left
[[32,54],[27,54]] var, right

: init
  \ Initial map position
  [0,0] const dup
  level swap map:pos! drop     \ Use the same position point with level 
  collision swap map:pos! drop \ and collision maps.

  \ Init player
  160 x !
  267 y !
  0 dx !
  0 dy !
  0 frame !
  10 dup delay ! time !
  false jumping !
  0 scrollx !
  false scrolling !
  0 flipx ! ;
  
: animate-player
  -1 time n:+!
  time @ 0 n:> !if
    jumping @ if
      2 frame !
    else
      dx @ 0 n:= not scrolling @ or if
        1 frame n:+!
        frame @ 2 n:mod frame !
      else
        0 frame !
      then
      delay @ time !
    then
  then ;

: draw-player
  x @ y @ SPRITE-WIDTH SPRITE-HEIGHT 4 a:close vp viewport:pos@ nip tilemap:rect-ofs+
  image @ flipx @ a:_@ 
  "white"
  0 frame @ SPRITE-HEIGHT n:* SPRITE-WIDTH SPRITE-HEIGHT 4 a:close
  nk:draw-sub-image ;

: tile-collision
  \ Sprite top to the top of viewport
  y @ 0 n:< if
    0 y !
    GRAVITY dy !
  then

  \ Platforms
  dy @ 0 n:> if
    collision vp viewport:pos@
    x @ y @ 2 a:close
    ' n:+ a:2map
    bottom @ flipx @ a:_@
    ' n:+ a:2map
    tilemap:color
    repeat
      xff7f00ff n:= !if
        break
      else
        -0.5 y n:+!
        collision vp viewport:pos@
        x @ y @ 2 a:close
        ' n:+ a:2map
        bottom @ flipx @ a:_@
        ' n:+ a:2map
        tilemap:color
      then
    again

    collision vp viewport:pos@
    x @ y @ 2 a:close
    ' n:+ a:2map
    bottom @ flipx @ a:_@
    ' n:+ a:2map
    1 a:@ n:1+ 1 swap a:!
    tilemap:color xff7f00ff n:= if
      0 dy !
      false jumping !
    then
  then

  \ Bottom of sprite
  collision vp viewport:pos@
  x @ y @ 2 a:close
  ' n:+ a:2map
  bottom @ flipx @ a:_@
  ' n:+ a:2map
  tilemap:color
  repeat
    xffff00ff n:= !if
      break
    else
      -0.5 y n:+!
      collision vp viewport:pos@
      x @ y @ 2 a:close
      ' n:+ a:2map
      bottom @ flipx @ a:_@
      ' n:+ a:2map
      tilemap:color
    then
  again

  collision vp viewport:pos@
  x @ y @ 2 a:close
  ' n:+ a:2map
  bottom @ flipx @ a:_@
  ' n:+ a:2map
  1 a:@ n:1+ 1 swap a:!
  tilemap:color xffff00ff n:= if
    0 dy !
    false jumping !
  then

  \ Right side of sprite
  collision vp viewport:pos@
  x @ y @ 2 a:close
  ' n:+ a:2map
  right @ flipx @ a:_@
  ' n:+ a:2map
  tilemap:color
  repeat
    xffff00ff n:= !if
      break
    else
      -0.5 x n:+!
      collision vp viewport:pos@
      x @ y @ 2 a:close
      ' n:+ a:2map
      right @ flipx @ a:_@
      ' n:+ a:2map
      tilemap:color
    then
  again

  \ Left side of sprite
  collision vp viewport:pos@
  x @ y @ 2 a:close
  ' n:+ a:2map
  left @ flipx @ a:_@
  ' n:+ a:2map
  tilemap:color
  repeat
    xffff00ff n:= !if
      break
    else
      0.5 x n:+! 
      collision vp viewport:pos@
      x @ y @ 2 a:close
      ' n:+ a:2map
      left @ flipx @ a:_@
      ' n:+ a:2map
      tilemap:color
    then
  again ;

: new-win
  {
    name: "main",
    title: "Testing...",           
    wide: @SCREEN-WIDTH,                     
    high: @SCREEN-HEIGHT,
    resizable: false,               
    bg: "black" 
  }
  nk:win ;

: draw
  level vp tilemap:draw 
  draw-player ; 

: update
  scan:LEFT nk:scancode? if
    dx @ 0 n:= if
      frame @ n:1+ 2 n:mod frame !
      delay @ time !
    then
    -0.5 dx n:+!
    dx @ -2.5 n:< if
      -2.5 dx !
    then
    1 flipx !
    x @ 4X-SPRITE-WIDTH n:< scrollx @ 0 n:> and if
      true scrolling !
      dx @ scrollx n:+!
      scrollx @ 0 n:< if
        0 scrollx !
      then
      level scrollx @ 0 map:move drop
    else
      false scrolling !
    then
  else   
    scan:RIGHT nk:scancode? if
      dx @ 0 n:= if
        frame @ n:1+ 2 n:mod frame !
        delay @ time !
      then
      0.5 dx n:+!
      dx @ 2.5 n:> if
        2.5 dx !
      then
      0 flipx !
      x @ VIEWPORT-WIDTH 4X-SPRITE-WIDTH n:- SPRITE-WIDTH n:- n:> scrollx @ MAP-WIDTH VIEWPORT-WIDTH n:- n:< and if
        true scrolling !
        dx @ scrollx n:+!
        scrollx @ MAP-WIDTH VIEWPORT-WIDTH n:- n:> if
          MAP-WIDTH VIEWPORT-WIDTH n:- scrollx !
        then
        level scrollx @ 0 map:move drop
      else
        false scrolling !
      then
    else
      0 dx !
      false scrolling !
    then
  then

  scan:UP nk:scancode? jumping @ not and if
    -10.5 dy !
  then

  scrolling @ !if
    dx @ x n:+!
  then
  GRAVITY dy n:+!  dy @ 0 n:= !if
    true jumping !
  then
  dy @ y n:+!
 
  \ Guard player keeps within allowed bounds
  x @ 0 VIEWPORT-WIDTH SPRITE-WIDTH n:- n:clamp x !

  tile-collision
  animate-player
   
  scan:ESCAPE nk:scancode? if
    bye
  then ;

: app:main
  new-win
  WAIT-VSYNC
  DT
  MAIN
  [ ' update ]
  [ ' draw ]
  main-render
  game:init
  init
  game:event-loop ;
Post Reply