Search found 52 matches
- Sun Oct 16, 2016 9:33 am
- Forum: Support and Development
- Topic: How do you table.insert a table into another table
- Replies: 4
- Views: 4123
Re: How do you table.insert a table into another table
Thanks for the reply, but you were like a minute too late :p I figured out how to fix the problem with the loadstring() function. loadstring() will help with a lot of things I need to do. Here is how I fixed this problem function loadmap(cm) mapfile = love.graphics.newImage("assets/maps/"....
- Sun Oct 16, 2016 8:11 am
- Forum: Support and Development
- Topic: How do you table.insert a table into another table
- Replies: 4
- Views: 4123
How do you table.insert a table into another table
This is the code I have function loadmap(cm) mapfile = love.graphics.newImage("assets/maps/"..cm..".png") obj = {} if cm == "Orgrimmar" then numobj = 2 obj1 = {918,928,258,257,"Stronghold"} obj2 = {200,100,405,239,"How"} end for i=1,numobj,1 do table...
- Sun Oct 16, 2016 3:30 am
- Forum: Support and Development
- Topic: How to move object at the same speed
- Replies: 4
- Views: 3140
Re: How to move object at the same speed
I'm having several problems with the code you posted. First, the != seems to be from another language. It's familiar to me, but doesn't work in lua. This is what lua uses ~= Also, the playerx and playery values need to be set in every if.isDown because if it is not, it will constantly move playerx a...
- Sat Oct 15, 2016 3:29 am
- Forum: Support and Development
- Topic: How to move object at the same speed
- Replies: 4
- Views: 3140
How to move object at the same speed
I am trying to make the movement speed from WASD the same as the move to mouse functions. Here is the code I have if love.mouse.isDown(mouse) then touchx = love.mouse.getX() touchy = love.mouse.getY() direction = math.atan2(touchy-(height/2), touchx-(width/2)) angle = direction*180/math.pi playerx =...
- Sat Oct 15, 2016 3:03 am
- Forum: Support and Development
- Topic: [SOLVED] How do you move X,Y towards mouse?
- Replies: 6
- Views: 4798
Re: How do you move X,Y towards mouse?
I found the problem and fixed it. I was referencing "playerx" for the correlation to the touchx when it should've been width/2 because playerx was the coordinates on the back.png for the quadrant. I was wondering why my angle variable was always returning around 2. All I needed to do was r...
- Sat Oct 15, 2016 1:44 am
- Forum: Support and Development
- Topic: [SOLVED] How do you move X,Y towards mouse?
- Replies: 6
- Views: 4798
Re: How do you move X,Y towards mouse?
Also, I need the map to move only a certain amount of pixels each update. Some tutorials I found were using fractions of the different between mouseX and startX.
- Sat Oct 15, 2016 1:19 am
- Forum: Support and Development
- Topic: [SOLVED] How do you move X,Y towards mouse?
- Replies: 6
- Views: 4798
Re: How do you move X,Y towards mouse?
Thanks for the responses :) I was able to successfully run the rectangle follow the mouse code, but I am having trouble having the map follow the mouse. All it does at the moment is increases x and y. Here is the code -------------------------------------------------------------------------------- f...
- Fri Oct 14, 2016 2:54 pm
- Forum: Support and Development
- Topic: [SOLVED] How do you move X,Y towards mouse?
- Replies: 6
- Views: 4798
[SOLVED] How do you move X,Y towards mouse?
I can seperate the screen into quadrants and when mouse clicks there it will move map accordingly, but they are in squares and requires a ton of code. I need to know how I can change X,Y values of an object to move towards the mouse.getX,mouse.getY. The closest thing I have found is another thread h...
- Sat Aug 13, 2016 10:08 pm
- Forum: Support and Development
- Topic: [Solved] Trying to center scaled images (solution at bottom)
- Replies: 5
- Views: 4274
Re: [Solved] Trying to center scaled images (solution at bottom)
Yeah this is the first game I've worked on, so I have a lot of learning. I'm working on learning the tilesets again. What I'm working on now is just to learn.
- Sat Aug 13, 2016 10:27 am
- Forum: Support and Development
- Topic: [Solved] Trying to center scaled images (solution at bottom)
- Replies: 5
- Views: 4274
Re: [Solved] Trying to center scaled images (solution at bottom)
I can just love.graphics.draw another map file after the sprite for layering to make sprite be behind things. The map file is 2560x1920 so it would fit all devices. The bigger screen you have, the more of the map you will be able to see at a time. I have a mid range phone, Moto E 2nd Gen and it's sc...