Show off your graphics!

Make games! Discuss those games here.

Moderators: Bob the Hamster, marionline, SDHawk

User avatar
Bob the Hamster
Liquid Metal King Slime
Posts: 7460
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

Here is what I am working on at the moment

<object width="500" height="313"><param name="allowfullscreen" value="true"><param name="allowscriptaccess" value="always"><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id= ... =0"><embed src="http://vimeo.com/moogaloop.swf?clip_id= ... y=0&loop=0" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="500" height="313"></embed></object>

I am re-using some of the scripts from Bell of Chaos for this. I wanted to work on a platformer with more traditional combat, since after re-playing Bell of Chaos, I remembered how frustrating it is to try and kill enemies.

This is still very much a work in progress.

Also, I am reminded of how much i hate doing maptiles. :P
User avatar
Meowskivich
Blubber Bloat
Posts: 2199
Joined: Tue Mar 06, 2012 12:38 am
Location: Earth
Contact:

Post by Meowskivich »

Awesomenesssssssssssssssss
dOn'T MiNd mE! i'M jUsT CoNtAgIoUs!!!
Play Orbs CCG: http://orbsccg.com/r/4r6x :V
User avatar
sheamkennedy
Liquid Metal Slime
Posts: 1110
Joined: Mon Sep 16, 2013 9:29 pm
Location: Tama-shi, Tokyo, Japan
Contact:

Post by sheamkennedy »

Bob the Hamster wrote:Here is what I am working on at the moment
That's so awesome! How did you do the parallax? Is it just a background slice that moves along with the screen focus as the maptiles slide by?
⊕ P E R S O N A L M U S I C: https://open.spotify.com/album/6fEo3fCm5C3XhtFRflfANr
� C O L L A B M U S I C: https://dustpuppets.bandcamp.com/releases
User avatar
Bob the Hamster
Liquid Metal King Slime
Posts: 7460
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

Thanks!

I designated map layer 0 and 1 to be parallax layers on every map.

When the map first loads, I loop through the maptiles and find the bottom-most right-most non-zero tile. I use that to calculate how big the parallax layer will be.

Then in my script that runs every tick to update the camera, I get the slice handles for those two map layers and adjust their x and y position based on the camera position.

Here is the script that I use to detect the size of a parallax layer

Code: Select all

script, get parallax size, para, layer, begin
  variable&#40;x, y, tile, found, fy&#41;
  found &#58;= false
  for&#40;y, map height -- 1, 0, -1&#41; do&#40;
    for&#40;x, 0, map width -- 1&#41; do&#40;
      tile &#58;= read map block&#40;x, y, layer&#41;
      if&#40;tile <> 0&#41; then&#40;
        fy &#58;= y
        set slice height&#40;para, &#40;y + 1&#41; * 20&#41;
        found &#58;= true
        break
      &#41;
    &#41;
    if&#40;found&#41; then&#40;break&#41;
  &#41;
  found &#58;= false
  for&#40;x, map width -- 1, 0, -1&#41; do&#40;
    for&#40;y, 0, fy&#41; do&#40;
      tile &#58;= read map block&#40;x, y, layer&#41;
      if&#40;tile <> 0&#41; then&#40;
        set slice width&#40;para, &#40;x + 1&#41; * 20&#41;
        found &#58;= true
        break
      &#41;
    &#41;
    if&#40;found&#41; then&#40;break&#41;
  &#41;
end
I store the size in the width and height of an invisible slice container.

here is the camera updating script:

Code: Select all

script, update camera, sl, begin
  variable&#40;x, y&#41;
  x &#58;= slice edge x&#40;sl, edge&#58;center&#41;
  y &#58;= slice edge y&#40;sl, edge&#58;bottom&#41; -- 20
  put camera&#40;x -- 160, y -- 100&#41;
  # Update parallax layers
  variable&#40;i, layer, para, layer sl, mapw, maph, screenw, screenh&#41;
  screenw &#58;= slice width&#40;sprite layer&#41;
  screenh &#58;= slice height&#40;sprite layer&#41;
  for&#40;i, 0, 1&#41; do&#40;
    para &#58;= slice child&#40;parallaxen, i&#41;
    if&#40;i == 0&#41;      then&#40;layer sl &#58;= lookup slice&#40;sl&#58;map layer 0&#41;&#41;
    else if&#40;i == 1&#41; then&#40;layer sl &#58;= lookup slice&#40;sl&#58;map layer 1&#41;&#41;
    mapw &#58;= map width * 20
    maph &#58;= map height * 20
    set slice x&#40;layer sl, &#40;camera pixel x  * &#40;mapw -- slice width&#40;para&#41;&#41; / large&#40;1, mapw -- screenw&#41;&#41;&#41;
    set slice y&#40;layer sl, &#40;camera pixel y  * &#40;maph -- slice height&#40;para&#41;&#41; / large&#40;1, maph -- screenh&#41;&#41;&#41;
  &#41;
end
Note that if you wanted to do this just for one map, and didn't mind hard-coding the size of the parallax layers, you could eliminate the first script entirely, and make the second script noticeably simpler.
TMC
Metal King Slime
Posts: 4101
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

sheamkennedy wrote:After watching some inspiring videos I decided to go for a much more minimal graphical style. It's taking me way less time to draw maptiles now and I think it's surprisingly better looking than what I was doing prior to this. Thoughts?
While I like these new graphics, I did prefer the previous ones, because I really liked the details. However, if you can draw these much faster than the previous ones and that leads to greater variety, then I suppose that for me personally the net effect will be better.
Bob the Hamster wrote:Here is what I am working on at the moment
Cool; I know that I can look forward to this.

The high walking speed and animation is the most noticeable thing for me. At least I thought it reminded me of Super Metroid, but I see its mechanics are a bit different. Actually, the walking animation doesn't match the walking speed (which I'm sure is actually very common), and that's why it stuck out at me.
Bob the Hamster wrote:Here is the script that I use to detect the size of a parallax layer
You can use "break(2)" to jump out of two nested loops. "continue(x)" also works. (Previously I even allowed jumping out of a variable number of loops, but since realised what a terrible idea that was). Also, I'm amused to see that your script is resolution independent.
Last edited by TMC on Sat Jan 04, 2014 1:10 pm, edited 1 time in total.
User avatar
Bob the Hamster
Liquid Metal King Slime
Posts: 7460
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

TMC wrote:
Bob the Hamster wrote:Here is the script that I use to detect the size of a parallax layer
You can use "break(2)" to jump out of two nested loops. "continue(x)" also works. (Previously I even allowed jumping out of a variable number of loops, but since realised what a terrible idea that was). Also, I'm amused to see that your script is resolution independent.
Oh, awesome! This feature is undocumented. I remember wondering if that feature existed, but after examining the entries in the plotscripting dictionary, decided it didn't.

The walking speed is probably a little too high right now, but it is nice for getting around while I am debugging things but have not implemented save/load yet.

I'll probably lower the default walking speed a bit, but add some kind of Boots of Speed equipable item for faster movement. I might even draw separate running animation sprites

Don't hold out any hope for getting the walking animation to synch with actual movement speed. If that happens it will just be luck :)
Last edited by Bob the Hamster on Sat Jan 04, 2014 2:07 pm, edited 1 time in total.
TMC
Metal King Slime
Posts: 4101
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

Opps.

I think that acceleration in platformers work well when you don't notice it, because there is a separate "starting to run" "animation" (which might just be differing frame times). Which implies that accelerating to full speed takes only the length of the animation, usually a few ticks. Sonic is the only commercial platformer I can think of where your character looks like its sliding around.
User avatar
Sparoku
Metal Slime
Posts: 308
Joined: Tue Jun 18, 2013 3:19 pm
Location: Dairy Queen
Contact:

Post by Sparoku »

Maybe there should be a "show off your scripts" thread. XD
"One can never improve enough nor should one stop trying to improve."
User avatar
BMR
Metal King Slime
Posts: 3310
Joined: Mon Feb 27, 2012 2:46 pm
Location: The Philippines
Contact:

Post by BMR »

SparElric wrote:Maybe there should be a "show off your scripts" thread. XD
That's not a bad idea actually.
Being from the third world, I reserve the right to speak in the third person.

Using Editor version wip 20170527 gfx_sdl+fb music_sdl
User avatar
Bob the Hamster
Liquid Metal King Slime
Posts: 7460
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

<object width="500" height="313"><param name="allowfullscreen" value="true"><param name="allowscriptaccess" value="always"><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id= ... =0"><embed src="http://vimeo.com/moogaloop.swf?clip_id= ... y=0&loop=0" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="500" height="313"></embed></object>

I love making enemy ai. I think it is probably my favorite thing about this project so far.

Making those damn ladder-ramps work correctly? My least favorite thing. Thank goodness they are done, and I shouldn't have to mess with them anymore!
Last edited by Bob the Hamster on Thu Jan 09, 2014 5:05 am, edited 1 time in total.
User avatar
Meowskivich
Blubber Bloat
Posts: 2199
Joined: Tue Mar 06, 2012 12:38 am
Location: Earth
Contact:

Post by Meowskivich »

Bob the Hamster wrote:<object width="500" height="313"><param name="allowfullscreen" value="true"><param name="allowscriptaccess" value="always"><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id= ... =0"><embed src="http://vimeo.com/moogaloop.swf?clip_id= ... y=0&loop=0" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="500" height="313"></embed></object>

I love making enemy ai. I think it is probably my favorite thing about this project so far.

Making those damn ladder-ramps work correctly? My least favorite thing. Thank goodness they are done, and I shouldn't have to mess with them anymore!
Shootin' petals, reminds me of those flowers from Yoshi's Island (which I used to know the names of, but I forget. I guess I'll look next time I play Tetris Attack)
dOn'T MiNd mE! i'M jUsT CoNtAgIoUs!!!
Play Orbs CCG: http://orbsccg.com/r/4r6x :V
User avatar
Sparoku
Metal Slime
Posts: 308
Joined: Tue Jun 18, 2013 3:19 pm
Location: Dairy Queen
Contact:

Post by Sparoku »

BMR wrote:
SparElric wrote:Maybe there should be a "show off your scripts" thread. XD
That's not a bad idea actually.
Thanks! ^.^
Meowskivich wrote:Shootin' petals, reminds me of those flowers from Yoshi's Island (which I used to know the names of, but I forget. I guess I'll look next time I play Tetris Attack)
Piranha plant? :???:

EDIT: Oh wait! Do you mean those flowers with the yellow balls for petals that Yoshi can eat and make eggs out of?! :D
Last edited by Sparoku on Thu Jan 09, 2014 10:42 am, edited 1 time in total.
"One can never improve enough nor should one stop trying to improve."
User avatar
Meowskivich
Blubber Bloat
Posts: 2199
Joined: Tue Mar 06, 2012 12:38 am
Location: Earth
Contact:

Post by Meowskivich »

dOn'T MiNd mE! i'M jUsT CoNtAgIoUs!!!
Play Orbs CCG: http://orbsccg.com/r/4r6x :V
User avatar
sheamkennedy
Liquid Metal Slime
Posts: 1110
Joined: Mon Sep 16, 2013 9:29 pm
Location: Tama-shi, Tokyo, Japan
Contact:

Post by sheamkennedy »

Last edited by sheamkennedy on Thu Jan 09, 2014 9:25 pm, edited 1 time in total.
⊕ P E R S O N A L M U S I C: https://open.spotify.com/album/6fEo3fCm5C3XhtFRflfANr
� C O L L A B M U S I C: https://dustpuppets.bandcamp.com/releases
User avatar
Bob the Hamster
Liquid Metal King Slime
Posts: 7460
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

Post Reply