Jump to content

[WIP]The subway surfers project


Recommended Posts

The subway surfers project

SO FAR I'VE DONE

skins

moving trains

barrels

coins

music

a short video, hope you like it

coin pickup

http://i.imgur.com/NRVQ6Ao.jpg

screen shot

dfuEZ3s.png

I though of adding power ups but those were useless

jetpack : just waste players will be able to go out of bounds

magnet : stuck with scripting

shoes : can do it with a pickup which which can change the gravity for some time but it will look ugly

working on carton building on the sides for scenary

please do give me suggestion and feedbacks for this project

Edited by Guest
Link to comment

Regarding the trains, you could attach a colshape to the train which sticks out a little on the train (longer, not wider) and when the player hits that colshape you could kill it.

  
createColRectangle() -- Create the colshape 
attachElements() -- Attach it to your train 
"onColShapeHit" -- Serversided event, triggered when a player hits a colshape 
killPed() -- Kill the player 
  

Link to comment
Regarding the trains, you could attach a colshape to the train which sticks out a little on the train (longer, not wider) and when the player hits that colshape you could kill it.
  
createColRectangle() -- Create the colshape 
attachElements() -- Attach it to your train 
"onColShapeHit" -- Serversided event, triggered when a player hits a colshape 
killPed() -- Kill the player 
  

thanks :) i will try now

I'll be happy to help you with such a project.

thanks, you can help me by giving me suggestion and feedbacks here :)

Link to comment
  • 2 weeks later...
  • 8 months later...

Add a matching animation on pressing down arrow to make players slip down the hurdles, by following:

  
onClientKey -- When he presses key (down_arrow in this case). 
setControlState -- Disable moving backwards. [url=https://wiki.multitheftauto.com/wiki/Control_names]https://wiki.multitheftauto.com/wiki/Control_names[/url] 
setPedAnimation -- Set a slipping animation. 
-- And a function to move ped while slipping down the hurdles, can also be done within the animations. 

Note that disabling backwards control will make ped not move backwards but on pressing down arrow, ped will still trigger the onClientKey event and there you can add checks to move ped while slipping down the hurdles.

Link to comment
Add a matching animation on pressing down arrow to make players slip down the hurdles, by following:
  
onClientKey -- When he presses key (down_arrow in this case). 
setControlState -- Disable moving backwards. [url=https://wiki.multitheftauto.com/wiki/Control_names]https://wiki.multitheftauto.com/wiki/Control_names[/url] 
setPedAnimation -- Set a slipping animation. 
-- And a function to move ped while slipping down the hurdles, can also be done within the animations. 

Note that disabling backwards control will make ped not move backwards but on pressing down arrow, ped will still trigger the onClientKey event and there you can add checks to move ped while slipping down the hurdles.

Cool :D

Link to comment
  • 1 month later...
  • Moderators

Well it would be nice to keep the camera static.

Like this:

local playerCameraTarget = {0,0,0} 
  
local extendLine2D = function ( x,y,x2,y2,length ) 
    local vx = x2 - x 
    local vy = y2 - y 
    local ratio = length/(getDistanceBetweenPoints2D ( x,y,x2,y2 )) 
    vx = vx*ratio 
    vy = vy*ratio 
    return (x + vx),(y + vy) 
end 
  
addEventHandler("onClientPreRender",root, 
function () 
    local playerX,playerY,playerZ = getElementPosition(localPlayer) 
    local cameraTargetX,cameraTargetY,cameraTargetZ = playerCameraTarget[1],playerCameraTarget[2],playerCameraTarget[3] 
    local distance2DFromCameraTarget = getDistanceBetweenPoints2D(cameraTargetX,cameraTargetY,playerX,playerY) 
    local cameraStartX,cameraStartY = extendLine2D(cameraTargetX,cameraTargetY,playerX,playerY,distance2DFromCameraTarget+6) 
    local cameraEndX,cameraEndY = extendLine2D(cameraTargetX,cameraTargetY,playerX,playerY,distance2DFromCameraTarget-10) 
    setCameraMatrix ( cameraStartX,cameraStartY,playerZ+1, cameraEndX,cameraEndY,playerZ, 0, 0, 70 ) 
end) 
  

Link to comment
  • 2 weeks later...
The subway surfers project

SO FAR I'VE DONE

skins

moving trains

barrels

coins

music

a short video, hope you like it

coin pickup

http://i.imgur.com/NRVQ6Ao.jpg

screen shot

dfuEZ3s.png

I though of adding power ups but those were useless

jetpack : just waste players will be able to go out of bounds

magnet : stuck with scripting

shoes : can do it with a pickup which which can change the gravity for some time but it will look ugly

working on carton building on the sides for scenary

please do give me suggestion and feedbacks for this project

Really good idea

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...