2d skateboard game
-
really need to get this motion sorted feel like its gonna be the hook i need to make it a fun and challenging game
iv messed with the c.right and c.left adding allsorts to get my player to (roll) move and slowly slow down on its own
with no joy any help would be greatly appreciated. -
@waldron hey, happy to have a look and give some suggestions if you'd like to share your friend-code and game?
And just to confirm, you're looking to build in acceleration/deceleration and some Y axis movement?
Awesome progress btw!
-
@Tratax sweet iv shared it, my code is Waldron 6256-2637-1602
-
@waldron said in 2d skateboard game:
@Tratax sweet iv shared it, my code is Waldron 6256-2637-1602
cheers yeah, acceleration/deceleration and some Y axis movement would be perfect
-
@waldron You're cooking with gas, my friend. Skateboard game looks awesome!
-
@waldron Whoa, you really nailed that animation, it's fantastic! Stylistically, it reminds me of an even better "Skate or Die" on the NES.
-
@waldron hey - have updated the code and favourited the edits with some suggestions, re-shared this if you want to take a look.
The way i think of it is the skateboard always running in a state of movement, initiliasing the movement speed lower and utilising an "acceleration" variable as a multiplier in small increments that increases to a max or decreases to a negative max depending on how fast you want to go only when the buttons are held
The else condition highlighted then exists for the purpose if nothing is presssed to reduce that acceleration variable until it reaches 0 - may need to be split out as I didnt try this with left movement you could use your c. left and right to count up or down on that multiplier possibly
-
Also, it's got a great feeling, keen to see how this progresses!
-
@Tratax legend thank you il have a gander now cheers man
-
@waldron All good! worth noting the camera movement speed also has the acc multiplier attached so that it can correctly match the speed of your skater
-
@Tratax great work man perfect, yes could go either way with this keep as is and keep flowing in one direction or fix the left to do the same as the right.
cheers man -
@waldron said in 2d skateboard game:
@Tratax great work man perfect, yes could go either way with this keep as is and keep flowing in one direction or fix the left to do the same as the right.
cheers manbtw your intros are fantastic to your games i still need to figure out how to load from intro to main game...
-
@waldron Thanks, the way I'm doing it still experimental and I'm not sure if its best practice but as everything is carried out sequentially, I try to take advantage of that.
Example:
// Call my intro/title function before the main game loop // Once this breaks, it then moves into the main game loop doIntro() // Main game loop loop .. Main game code goes here update() repeat // All my functions live at the bottom of the code function doIntro() loop clear() .. .. Do your fun title code here .. c = controls( 0 ) if c.a then break endif update() repeat return void
-
This post is deleted! -
Update, more tricks, more level drawn and forward motion roll thanks to tratax!
Lots more moves/tricks to come. -
I am impressed, reminds me of California Games. Also it was a BMX discipline there. It looks like this will be as fun as well.
-
This is looking AWESOME. Keep up the good work!
-
so im at the point where im updating this whole game with every thing iv learnt so far anything i learn after i will make a 2nd game in the series but for this one im wanting to add 2 other elements im not sure on how to implement..
1.entering end of level - to level 2, entering house/shop screen
kind of know how to do it but is there a better way?House()
Endlevel1()
Shop()
thinking of creating an item that il mask in the screen so... black door way with black item
collect = said item then house.2.slopes collision edge detection so player can move diagonally on a 2d game
-
You don't necessarily need to create an item to collect to go to the house. You cold simply add a door sprite and check if the player collided with the door. Then you know you'll need to load / display your house.
-
@waldron I just implemented board switching in my game last night! What I did was define each board in an array, with a sub-array containing all of the sprite definitions for that level. By "definitions", I mean the X and Y coordinates of each sprite, the type (such as "teleporter"), and (for teleporters) the destination board and X-Y coordinates, for when the player touches the teleporter.
I have a function called "switchMap()", which grabs the appropriate board element, loops through the definitions for that stage, and populates the level. It does this by creating and adding sprites to an "actors" array, mapping over the properties from the definition to the sprite (so the teleporter sprite will have properties like "targetX", "targetY", "targetBoard", etc.).
This all makes my "draw()" function trivial; it just loops through the "actors" array and draws each sprite according to the properties. Adding a new element to a board takes like ten seconds: just copy and paste an array entry in the board's "definitions" sub-array. Done!
In my main game loop where I'm checking for sprite collisions, if the 'currentSprite.type == "teleporter"', I call my "switchMap()" function, which unloads the current map, loads the "sprite.targetBoard" one, resets the player's X and Y coordinates to "sprite.targetX / sprite.targetY", and boom-- the player is now on the new map, in the correct spot.
I even have "switchMap()" switch the background music to the correct song, which I have in a property in my "boards" array. I have a working transition between a city "overworld" and a sewer "dungeon", and it was really gratifying the first time I could leap between the two at will.
Hope that helps at least somewhat!