This is my "game." I constructed it mostly through the guidance of munkeebacon's YouTube channel and browsing older posts here for extra coding tips. It's pretty basic, and by "basic" I mean "what, you call that a game?!" But hey, I can jump!
I pretty much have three separate sections I need help on, so feel free to comment on any of them, all of them, or none of them.
1. Menu Screen. I would like to turn the menu buttons into a character-select wheel so you can select a particular character or quit the game. Most of them will be unused for now, but I'll be able to add more characters and game modes as the project goes on.
2. Animations. How do I animate sprites? Because at the moment my protagonist just looks like a big ominously floating statue. He can't seem to turn around either.
3. Platforming. How do I make collision and platforming? I need tiles/platforms that neither enemies nor the player can move through.
Menu Screens, Animation and Platforming
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- GungnirDev
- Party member
- Posts: 119
- Joined: Thu Jun 28, 2012 10:31 pm
Menu Screens, Animation and Platforming
- Attachments
-
- PSgame.love
- (317.93 KiB) Downloaded 118 times
Bullets are the beauty of the blistering sky
Bullets are the beauty and I don't know why
Bullets are the beauty and I don't know why
Re: Menu Screens, Animation and Platforming
I made a class for #3, though it only works with polygons (rectangles) and circles.
You can easily set properties of a "Part" or "Circle" by doing stuff like:
It also has a Touched event handler:
If this will work for you, let me know.
You can easily set properties of a "Part" or "Circle" by doing stuff like:
Code: Select all
part = Instance.new("Part")
part.Name = "Part 01"
part.CanCollide = true -- force other cancollide-true bodies to collide
part.Anchored = true -- don't allow physics to move the part
Code: Select all
hookEvent(p, "Touched", (function(part)
print(part.Name.." touched me. I don't like being touched. Nooo!")
end))
Re: Menu Screens, Animation and Platforming
Yes you can! But you can start correcting two small bad practices even that don't do for now much problems. You have two "main.draw" (so first one is ignored and you avoid error of "text" var not defined). Also you have your "love.keypressed(key)" inside "love.load" (controls still work but not intended to be there). Don't worry, keep working.thesmeagle wrote:It's pretty basic, and by "basic" I mean "what, you call that a game?!" But hey, I can jump!
Re: Menu Screens, Animation and Platforming
For animation, I highly recommend Kikito's anim8 library: http://github.com/kikito/anim8thesmeagle wrote:2. Animations. How do I animate sprites? Because at the moment my protagonist just looks like a big ominously floating statue. He can't seem to turn around either.
For finding libraries in general, use the Category:Libraries page from the wiki: https://love2d.org/wiki/Category:Libraries
-
- Prole
- Posts: 15
- Joined: Sun Jul 01, 2012 7:33 pm
Re: Menu Screens, Animation and Platforming
I'm honored. I have been planning to do a tutorial on animations for a while, but the other things are to specific for a tutorial. But really, It's awesome to know that people have been using my videos!
- GungnirDev
- Party member
- Posts: 119
- Joined: Thu Jun 28, 2012 10:31 pm
Re: Menu Screens, Animation and Platforming
@ Bannana: That looks useful, it's just that how do I position the collision blocks? Do I need x-y coordinates?
@ kexisse: Where do I put that? Do I copy the code into a lua file, or is that an example, or what?
@ coffee: I will fix the duplicates, thx, it's always nice to kill code you don't need.
@ munkeebacon: yeah they're definitely the best love tutorials on YouTube. Of course, to be fair love is painfully underrepresented on YouTube so there's not much to compare them to, but they were still really helpful. So if anything you're a trailblazer
@ kexisse: Where do I put that? Do I copy the code into a lua file, or is that an example, or what?
@ coffee: I will fix the duplicates, thx, it's always nice to kill code you don't need.
@ munkeebacon: yeah they're definitely the best love tutorials on YouTube. Of course, to be fair love is painfully underrepresented on YouTube so there's not much to compare them to, but they were still really helpful. So if anything you're a trailblazer
Bullets are the beauty of the blistering sky
Bullets are the beauty and I don't know why
Bullets are the beauty and I don't know why
Re: Menu Screens, Animation and Platforming
It's an external library. You download the file and require() it.thesmeagle wrote:@ kexisse: Where do I put that? Do I copy the code into a lua file, or is that an example, or what?
If you had scrolled down on that page, you would have seen an example of how to use the anim8.lua file:
Code: Select all
local anim8 = require 'anim8'
local image, animation
function love.load()
image = love.graphics.newImage('path/to/image.png')
local g = anim8.newGrid(32, 32, image:getWidth(), image:getHeight())
animation = anim8.newAnimation('loop', g('1-8,1'), 0.1)
end
function love.update(dt)
animation:update(dt)
end
function love.draw()
animation:draw(image, 100, 200)
end
Re: Menu Screens, Animation and Platforming
Yeah, you'd use variableName.Position = Vector2.new(10, 10) -- (x,y)thesmeagle wrote:@ Bannana: That looks useful, it's just that how do I position the collision blocks? Do I need x-y coordinates?
Who is online
Users browsing this forum: Bing [Bot] and 1 guest