Author Topic: slippery  (Read 5411 times)

billybob884

  • Contributor
  • Fanatic
  • **
  • Posts: 355
    • AOL Instant Messenger - billybob884
    • View Profile
slippery
« on: 2005-05-28, 12:38:31 PM »
Hey, was wondering if there was a way to make tiles 'slippery', like I know that you can just set the players inertia really high, but I meant specifically angled tiles. Basically I want the player to act like it's not ground when he jumps on an angled tile, but it would still have its solid properties, so the player would just slide right off. If there no easy way to do this (i.e. w/o scripting), I've got a few work-arounds I can do, so it's no big deal, I was just curious.
"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." :: Hitchhiker's Guide to the Galaxy

durnurd

  • Lead Lemming
  • Expert
  • Fanatic
  • *****
  • Posts: 1234
  • Games completed so far: 0
    • MSN Messenger - durnurd@hotmail.com
    • View Profile
    • Find My Ed
slippery
« Reply #1 on: 2005-05-28, 05:02:28 PM »
Well, without scripting, I can think of one idea, but I can't test it right now.  Try this:

Create a special function that teleports the player relatively to 1,1.  Then, create a tile interaction for tiles that slope down and to the right which activates this function.

I don't know how well that will work, but if it does, then do the same thing for left tiles, only using -1,1 for the teleport parameters.
Edward Dassmesser

billybob884

  • Contributor
  • Fanatic
  • **
  • Posts: 355
    • AOL Instant Messenger - billybob884
    • View Profile
slippery
« Reply #2 on: 2005-05-28, 10:33:58 PM »
Hey, thats a good idea, I'll give it a shot tomorrow (or later today, for those anal people :) ), but I think I see a problem, if the player just held the forward button (right key for slope up tiles, left for slope down tiles) wouldn't the forward movement cancel out the teleport function, causing the player to stand still?
"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." :: Hitchhiker's Guide to the Galaxy

durnurd

  • Lead Lemming
  • Expert
  • Fanatic
  • *****
  • Posts: 1234
  • Games completed so far: 0
    • MSN Messenger - durnurd@hotmail.com
    • View Profile
    • Find My Ed
slippery
« Reply #3 on: 2005-05-28, 11:17:12 PM »
Depending on whether you want that to happen or not (considering you say it's a problem, then  probably not) that can be remedied.  However, I don't think it is a problem.  This only teleports one pixel per frame, but the maximum velocity of a sprite can be greater than that.  Generally around 4 ppf is a normal maximum sprite movement speed if I'm not mistaken.

If it is a problem, then you can raise the speed of your sprite, or alternately, instead of activating the funtion, have a couple of functions to only make it activate half the time or so.  If you need that, I can come up with a way to do that, but I'm sure you can figure it out using inventory, and I'm too tired to stay awake, so I'll fall asleep if I try right now.
Edward Dassmesser

billybob884

  • Contributor
  • Fanatic
  • **
  • Posts: 355
    • AOL Instant Messenger - billybob884
    • View Profile
slippery
« Reply #4 on: 2005-05-29, 07:22:01 AM »
Ok, here's what I've found so far:
If you want it to look 'realistic', as far as how fast you'd expect the player to slide, you need to set the teleport to at least 3. Also, if you don't want the player to be buried in the ground when he hits the last sloped tile (assuming that you will put solid tiles at the end of the slope), you have to have the last one only look like the regular slippery tiles, but is only defined (in solidity) as a regular sloped one. One other bug is that if you hold forward (right for uphill, left for downhill) and repedly press the up key you can slowly climb up the 'slippery' tiles, the only way I've found to stop this is to set teleport up to 4, but this makes a VERY FAST slide effect, so for my purposes I can live with the player being able to climb with teleport set at 3, becasue chances are I'll have some other element blocking his path. Thanks!


-----also-----
While were on the topic of teleporting, does the teleport function work for any sprite or just the player? Because I may or may not end up using it when the 2nd player hits a certain sprite in a multi-player level.
"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." :: Hitchhiker's Guide to the Galaxy

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
slippery
« Reply #5 on: 2005-05-29, 04:50:46 PM »
Special functions only work for the player by default.  If you want special functions to affect another sprite, you need to create a player object for it in script and make the proper calls to check for map interactions or something.

durnurd

  • Lead Lemming
  • Expert
  • Fanatic
  • *****
  • Posts: 1234
  • Games completed so far: 0
    • MSN Messenger - durnurd@hotmail.com
    • View Profile
    • Find My Ed
slippery
« Reply #6 on: 2005-05-29, 08:30:38 PM »
Another option, if you don't want the player to ever be able to get back up there, is to create two tiles, one that looks like the background (if it's transparent, just have one pixel that is only slightly different from the backbround) and another that looks like the sloped tile, but define them both as fully solid.  Then, the tile collisions should switch the sloped tile with the other sloped tile that is solid, and when landing on solid ground again, activate a special function that copies several solid invisible tiles above the slope so the player cannot jump over it, like this:

(# is solid, \ is slope, p is player)

Before:
Code: [Select]

  p






Middle:
Code: [Select]







After:
Code: [Select]






Edward Dassmesser

durnurd

  • Lead Lemming
  • Expert
  • Fanatic
  • *****
  • Posts: 1234
  • Games completed so far: 0
    • MSN Messenger - durnurd@hotmail.com
    • View Profile
    • Find My Ed
slippery
« Reply #7 on: 2005-05-29, 08:32:38 PM »
Oh, and if you do it that way, both of the sloped tiles should teleport the player.

Actually, now that I think of it, here's a better idea:

Scratch the whole downward slope thing.  Just make them completely solid tiles to begin with.  Then the player sprite can't jump up because it's in solid, and the sliding down the slope is taken care of with the teleporting.
Edward Dassmesser

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
slippery
« Reply #8 on: 2005-05-30, 06:01:41 AM »
Should the player be able to get back up if he jumps?

billybob884

  • Contributor
  • Fanatic
  • **
  • Posts: 355
    • AOL Instant Messenger - billybob884
    • View Profile
slippery
« Reply #9 on: 2005-05-31, 08:46:55 PM »
Well, no, one of the reasons for the slippery tiles was to get the player to a place he wouldnt be able to get back up, and part was just because it goes with the level's theme. But unfortunately, I've got a lot of tests this week, plus SAT's this Saturday, then for the next 3 weeks it's going to be projects & oral presentations on top of preparing for final exams, and to top it all off I just got a job; so most, if not all of the work being done on my game is coming to a screeching halt until I can either find some free time (maybe this Sunday) or until after finals are over. I might as well mention that my progress had already been somewhat hindered due to SAT prep the last few weeks. I'll still check the forum occasionally during this upcoming period, but not much will get done. This'll probably push my way over-due end date back nearly another month. I was hoping to be done by mid/end of August, because that'll be the 1-year mark from when I started working on this. God, has it been that long already?
"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." :: Hitchhiker's Guide to the Galaxy

durnurd

  • Lead Lemming
  • Expert
  • Fanatic
  • *****
  • Posts: 1234
  • Games completed so far: 0
    • MSN Messenger - durnurd@hotmail.com
    • View Profile
    • Find My Ed
slippery
« Reply #10 on: 2005-05-31, 11:38:41 PM »
In any case, if/when you do get a chance, try doing the last thing I suggested (just making them solid and teleporting through).

I just tested it and it seems to work well for all intents and purposes.
Edward Dassmesser

billybob884

  • Contributor
  • Fanatic
  • **
  • Posts: 355
    • AOL Instant Messenger - billybob884
    • View Profile
slippery
« Reply #11 on: 2005-06-04, 08:09:46 PM »
wait, if i made all of the slanted tiles solid, when the player jumped and landed back down on them wouldnt it look like he was sliding on thin-air? also, the sliding is just so the player cant get back up teh slide, you see he'll be standing on this rock-like platform thats going down the angled wall, so the whole point of it being slippery is so he won't be able to get back up (and its a long slope, so i doubt that anyone would waste (idk, maybe 5-10 min?) trying to climb back up.
"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." :: Hitchhiker's Guide to the Galaxy

durnurd

  • Lead Lemming
  • Expert
  • Fanatic
  • *****
  • Posts: 1234
  • Games completed so far: 0
    • MSN Messenger - durnurd@hotmail.com
    • View Profile
    • Find My Ed
slippery
« Reply #12 on: 2005-06-05, 07:13:32 AM »
Well, that's the best I can think of w/o scripting.

Here's an idea.  Along with my previous idea, just make a cliff at the end, like this:

Code: [Select]










Then they can't even jump back up if they wanted to.[/code]
Edward Dassmesser